def run_comparison(data_path, output_path, seed=None, thresh=0.5):
    import ipdb; ipdb.set_trace()
    if seed is None:
        seed = np.random.randint(2**32)

    print "Setting seed to ", seed
    np.random.seed(seed)

    assert os.path.exists(os.path.dirname(output_path)), "Output directory does not exist!"

    if data_path.endswith("_oopsi.pkl.gz"):
        # The oopsi data has a probability of spike
        with gzip.open(data_path, 'r') as f:
            P, F, Cf, network, pos = cPickle.load(f)
            S_full = P > thresh
            # onespk = np.bitwise_and(P > thresh, Cf < 0.3)
            # twospk = np.bitwise_and(P > thresh, Cf >= 0.3)
            # S_full = np.zeros_like(P)
            # S_full[onespk] = 1
            # S_full[twospk] = 2

    elif data_path.endswith(".gz"):
        with gzip.open(data_path, 'r') as f:
            S_full, F, bins, network, pos = cPickle.load(f)
    else:
        with open(data_path, 'r') as f:
            S_full, F, bins, network, pos = cPickle.load(f)

    # Cast to int
    S_full = S_full.astype(np.int)

    # Train on all but the last ten minutes (20ms time bins = 50Hz)
    T_train = 10 * 60 * 50
    T_test = 10 * 60 * 50
    # S      = S_full[:-T_test, :]
    S      = S_full[:T_train, :]
    S_test = S_full[-T_test:, :]

    K      = S.shape[1]
    C      = 1
    dt     = 0.02
    dt_max = 0.08

    # Compute the cross correlation to estimate the connectivity
    print "Estimating network via cross correlation"
    W_xcorr = infer_net_from_xcorr(S, dtmax=dt_max // dt)

    # HACK! Select the threshold by looking at the data
    test_thresholds = False
    if test_thresholds:
        print "Estimating network via cross correlation"
        F_xcorr = infer_net_from_xcorr(F, dtmax=3)
        aucs, _, _ = compute_auc_roc(network, W_xcorr=F_xcorr)
        print "AUC F: ", aucs["xcorr"]
        for thresh in np.linspace(0.1, 0.95, 20):
            S_thr = (P > thresh).astype(np.int)
            S_train = S_thr[:T_train, :]

            W_tmp = infer_net_from_xcorr(S_train, dtmax=dt_max // dt)
            aucs, _, _ = compute_auc_roc(network, W_xcorr=W_tmp)
            print "AUC (", thresh, "): ", aucs["xcorr"]

        import pdb; pdb.set_trace()

    # Fit a standard Hawkes model on subset of data with BFGS
    bfgs_model, bfgs_time = \
        fit_standard_hawkes_model_bfgs_noxv(S, K, dt, dt_max,
                                            output_path=output_path,
                                            W_max=None)

    # Fit a network Hawkes model with Gibbs
    gibbs_samples = gibbs_timestamps = None
    gibbs_samples, gibbs_timestamps = \
        fit_network_hawkes_gibbs(S, K, C, dt, dt_max,
                                 output_path=output_path,
                                 standard_model=bfgs_model)

    # gibbs_samples, gibbs_timestamps = \
    #     fit_ct_network_hawkes_gibbs(S, K, C, dt, dt_max,
    #                              output_path=output_path,
    #                              standard_model=bfgs_model)

    # Fit a network Hawkes model with Batch VB
    # vb_models, vb_timestamps = fit_network_hawkes_vb(S, K, dt, dt_max,
    #                                          standard_model=standard_models[-1])
    #
    # with open(output_path + ".vb.pkl", 'w') as f:
    #     print "Saving VB results to ", (output_path + ".vb.pkl")
    #     cPickle.dump((vb_models, timestamps), f, protocol=-1)

    # Fit a network Hawkes model with SVI
    # svi_models = None
    svi_models, timestamps = fit_network_hawkes_svi(S, K, C, dt, dt_max,
                                                    output_path,
                                                    standard_model=bfgs_model,
                                                    true_network=network)

    # Plot the network and its uncertainty
    import ipdb; ipdb.set_trace()

    # Compute area under roc curve of inferred network
    auc_rocs, fprs, tprs = compute_auc_roc(network,
                               W_xcorr=W_xcorr,
                               bfgs_model=bfgs_model,
                               gibbs_samples=gibbs_samples,
                               svi_models=svi_models)
    print "AUC-ROC"
    pprint.pprint(auc_rocs)

    plot_roc_curves(fprs, tprs, fig_path=output_path)

    # Compute area under precisino recall curve of inferred network
    auc_prcs, precs, recalls = compute_auc_prc(network,
                               W_xcorr=W_xcorr,
                               bfgs_model=bfgs_model,
                               gibbs_samples=gibbs_samples,
                               svi_models=svi_models)
    print "AUC-PRC"
    pprint.pprint(auc_prcs)

    plot_prc_curves(precs, recalls, fig_path=output_path)


    # Compute the predictive log likelihoods
    plls = compute_predictive_ll(S_test, S,
                                 bfgs_model=bfgs_model,
                                 gibbs_samples=gibbs_samples,
                                 svi_models=svi_models)

    print "Log Predictive Likelihoods: "
    pprint.pprint(plls)

    # # Plot the predictive log likelihood
    # # N_iters = plls['svi'].size
    # N_iters = 100
    # N_test  = S_test.size
    # plt.ioff()
    # plt.figure()
    # plt.plot(np.arange(N_iters),
    #          (plls['bfgs'] - plls['homog'])/N_test * np.ones(N_iters),
    #          '-b', label='BFGS')
    # import pdb; pdb.set_trace()
    # plt.plot(np.arange(N_iters),
    #          (plls['svi'] - plls['homog'])/N_test * np.ones(N_iters),
    #          '-g', label='SVI')c
    #
    # # plt.plot(np.arange(N_iters),
    # #          (plls['svi'] - plls['homog'])/N_test,
    # #          '-r', label='SVI')
    # plt.xlabel('Iteration')
    # plt.ylabel('Log Predictive Likelihood')
    # plt.legend()
    # plt.show()
Returns True if the specified operator can successfully
dataset/ETHPy150Open slinderman/pyhawkes/experiments/chalearn_small_comparison.py/run_comparison--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/scheduler/filters/json_filter.py/JsonFilter._op_compare