Ejemplo n.º 1
0
def main():
    # pylint: disable=missing-function-docstring
    setup_logging()
    cmdargs = parse_cmdargs()

    dgen, args, model, _outdir, plotdir = standard_eval_prologue(cmdargs)

    truth_array, preds_array = get_truth_preds_arrays(dgen, model)
    labels = convert_targets_to_labels(args.target_pdg_iscc_list)

    truth = truth_array[:cmdargs.limit]
    preds = preds_array[:cmdargs.limit, :]

    embedded_preds = calc_embedding(preds, cmdargs.perplexity, cmdargs.dims)

    fname_base = 'tsne_%d_perp(%e)_lim(%d)' % (
        cmdargs.dims, cmdargs.perplexity, cmdargs.limit)

    fname_base = os.path.join(plotdir, fname_base)

    if cmdargs.dims == 2:
        plot_2d_embedding_scatter(truth, embedded_preds, labels, fname_base,
                                  cmdargs.ext)
        plot_2d_embedding_density(truth, embedded_preds, labels, cmdargs.bins,
                                  fname_base, cmdargs.ext)
Ejemplo n.º 2
0
def main():
    # pylint: disable=missing-function-docstring
    setup_logging()
    cmdargs = parse_cmdargs()

    dgen, args, model, _outdir, plotdir = standard_eval_prologue(cmdargs)

    truth_array, preds_array = get_truth_preds_arrays(dgen, model)
    sgn_bkg_cumsums          = calc_sgn_bkg_cumsums(
        truth_array, preds_array, dgen.weights, cmdargs.bins
    )

    fom_dict = {
        k : calc_foms(sgn_bkg_cumsums, func) \
            for k, func in FOM_SPEC_DICT.items()
    }

    labels = convert_targets_to_labels(args.target_pdg_iscc_list)

    for fom_label, rhist_fom_list in fom_dict.items():
        plot_separate_foms(
            rhist_fom_list, labels, fom_label, plotdir, cmdargs.ext
        )

    plot_overlayed_foms(
        fom_dict, [ 'efficiency', 'purity', 'selection' ],
        labels, plotdir, cmdargs.ext
    )
Ejemplo n.º 3
0
def main():
    # pylint: disable=missing-function-docstring
    setup_logging()
    cmdargs = parse_cmdargs()

    dgen, args, reco_preds, outdir, plotdir = reco_eval_prologue(cmdargs)

    err_mat = calc_reco_err_matrix(reco_preds, dgen)
    save_error_matrix(outdir, err_mat)

    labels = convert_targets_to_labels(args.target_pdg_iscc_list)
    plot_error_matrix(err_mat, labels, plotdir, cmdargs.ext)
Ejemplo n.º 4
0
def main():
    # pylint: disable=missing-function-docstring
    setup_logging()
    cmdargs = parse_cmdargs()

    dgen, args, model, outdir, plotdir = standard_eval_prologue(cmdargs)

    err_mat = make_error_matrix(dgen, model, args.target_pdg_iscc_list)
    save_error_matrix(outdir, err_mat)

    labels = convert_targets_to_labels(args.target_pdg_iscc_list)
    plot_error_matrix(err_mat, labels, plotdir, cmdargs.ext)
Ejemplo n.º 5
0
def main():
    # pylint: disable=missing-function-docstring
    setup_logging()
    cmdargs = parse_cmdargs()

    dgen, args, model, _outdir, plotdir = standard_eval_prologue(cmdargs)

    truth_array, preds_array = get_truth_preds_arrays(dgen, model)
    labels = convert_targets_to_labels(args.target_pdg_iscc_list)

    plot_distributions(
        truth_array, preds_array, dgen.weights, cmdargs.bins, labels,
        plotdir, cmdargs.ext
    )
Ejemplo n.º 6
0
def main():
    # pylint: disable=missing-function-docstring
    setup_logging()
    cmdargs = parse_cmdargs()

    args = Args.load(savedir = cmdargs.outdir)
    eval_config = EvalConfig.from_cmdargs(cmdargs)

    eval_config.modify_eval_args(args)

    _, dgen = load_data(args)
    outdir  = make_eval_outdir(cmdargs.outdir, eval_config)
    plotdir = make_plotdir(outdir)

    counts = count_events(dgen)
    labels = convert_targets_to_labels(args.target_pdg_iscc_list)

    plot_counts(counts, labels, plotdir, cmdargs.ext)