Exemple #1
0
def feat_weight_graphs(setting):
    if setting.feat_weight_graphs:
        feat_names = [feat.name for feat in setting.descriptor]

        for log_fname in setting.dev_log_fns + setting.val_log_fns:
            out_fname = os.path.splitext(log_fname)[0] + ".fwg"
            outf = open(out_fname, "w")
            field_names, table = parse_feat_weights(log_fname, feat_names)
            graph_table(field_names, table, outf)
            print_table(field_names, table, outf)
Exemple #2
0
def feat_weight_graphs(setting):
    if setting.feat_weight_graphs:
        feat_names = [feat.name for feat in setting.descriptor]

        for log_fname in setting.dev_log_fns + setting.val_log_fns:
            out_fname = os.path.splitext(log_fname)[0] + ".fwg"
            outf = open(out_fname, "w")
            field_names, table = parse_feat_weights(log_fname, feat_names)
            graph_table(field_names, table, outf)
            print_table(field_names, table, outf)
Exemple #3
0
__author__ = 'Erwin Marsi <*****@*****.**>'
__version__ = "0.5"

parser = ArgumentParser(description=__doc__,
                        version="%(prog)s version " + __version__,
                        formatter_class=RawDescriptionHelpFormatter)

parser.add_argument("-n",
                    "--names",
                    metavar="FILE",
                    help="file with feature names, one per line")

parser.add_argument("-t",
                    "--table",
                    action='store_true',
                    help="also print feature weight table")

args = parser.parse_args()

if args.names:
    feat_names = parse_feature_names(args.names)
else:
    feat_names = []

field_names, table = parse_feat_weights(sys.stdin, feat_names)

graph_table(field_names, table)

if args.table:
    print_table(field_names, table)
        
parser = ArgumentParser(description=__doc__,
                        version="%(prog)s version " + __version__,
                        formatter_class=RawDescriptionHelpFormatter)

parser.add_argument("-n", "--names",
                    metavar="FILE",
                    help="file with feature names, one per line")

parser.add_argument("-t", "--table",
                    action='store_true',
                    help="also print feature weight table")

args = parser.parse_args()



if args.names: 
    feat_names = parse_feature_names(args.names)
else:
    feat_names = []
    

field_names, table = parse_feat_weights(sys.stdin, feat_names)    
    
graph_table(field_names, table)

if args.table:
    print_table(field_names, table)