def main(): args = parse_args() scores = load_score_file(args.input) experiment = Experiment[args.experiment] dimensionality = Dimensionality[args.dim] missing_strategy = MissingStrategy[args.missing] filtered_scores = filter_scores( scores, experiment, dimensionality, missing_strategy=missing_strategy ) n_datasets = len(filtered_scores) avg_ranks, all_ranks = compute_ranks(filtered_scores, higher_better=True) if args.mode == "global": global_tests = global_difference(avg_ranks, n_datasets) if args.output: with open(args.output, "w") as fp: fp.write( "F = %.1f (p = %g)\n" % (global_tests["F"]["stat"], global_tests["F"]["prob"]) ) fp.write( "χ = %.1f (p = %g)" % ( global_tests["chi"]["stat"], global_tests["chi"]["prob"], ) ) else: print( "F = %.1f (p = %g)" % (global_tests["F"]["stat"], global_tests["F"]["prob"]) ) print( "χ = %.1f (p = %g)" % ( global_tests["chi"]["stat"], global_tests["chi"]["prob"], ) ) elif args.mode == "pairwise": CD, txt = pairwise_difference_report(avg_ranks, n_datasets) print("\n".join(txt)) elif args.mode == "reference": ref_method, CD, txt = reference_difference_report( avg_ranks, n_datasets ) if args.output: outRef = args.output + "_ref.tex" with open(outRef + "w") as fp: fp.write(outRef + "%") outCD = args.output + "_CD.tex" with open(outCD + "w") as fp: fp.write(outCD + "%") else: print("Reference method = %s, CD = %.2f" % (ref_method, CD)) print("") print("\n".join(txt))
def main(): args = parse_args() scores = load_score_file(args.input) experiment = Experiment[args.experiment] dimensionality = Dimensionality[args.dim] missing_strategy = MissingStrategy[args.missing] filtered_scores = filter_scores(scores, experiment, dimensionality, missing_strategy=missing_strategy) make_rank_plot(filtered_scores, args.output, higher_better=True)
def main(): args = parse_args() default_cover = load_score_file(args.default_cover) default_f1 = load_score_file(args.default_f1) oracle_cover = load_score_file(args.oracle_cover) oracle_f1 = load_score_file(args.oracle_f1) missing_strategy = MissingStrategy[args.missing] tex = make_table( default_cover, default_f1, oracle_cover, oracle_f1, missing_strategy=missing_strategy, ) tex = PREAMBLE + tex + EPILOGUE if args.standalone else tex if args.output: with open(args.output, "w") as fp: fp.write("\n".join(tex)) else: print("\n".join(tex))
def main(): args = parse_args() experiment = Experiment[args.experiment] dimensionality = Dimensionality[args.dim] missing_strategy = MissingStrategy[args.missing] scores = load_score_file(args.score_file) filtered_scores = filter_scores(scores, experiment, dimensionality, missing_strategy=missing_strategy) _, all_ranks = compute_ranks(filtered_scores, higher_better=True) complete_ranks = expand_ranks(all_ranks) write_json(complete_ranks, output_file=args.output_file)
def main(): args = parse_args() scores = load_score_file(args.input) experiment = Experiment[args.experiment] dimensionality = Dimensionality[args.dim] missing_strategy = MissingStrategy[args.missing] filtered_scores = filter_scores(scores, experiment, dimensionality, missing_strategy=missing_strategy) texlines = make_cd_diagram_tex(filtered_scores, test=args.test) tex = "\n".join(texlines) with open(args.output, "w") as fp: fp.write(tex) pdf_name = os.path.splitext(args.output)[0] + ".pdf" build_latex_doc(tex, output_name=pdf_name)