"split_id",
    "model",
    "metric",
    "value",
    "config",
])

for split_id, res in enumerate(results):
    for metric_name, val in res.items():

        df.loc[len(df)] = (
            time,
            dataset,
            split_id,
            "Groundtruth",
            metric_name,
            val,
            vars(args),
        )

export_csv(df, "data/output/results.csv", append=True)

if args.fit:
    with Timer("Fitting a hawkes process"):
        learner = HawkesExpKern(
            decays=np.full((args.n_types, args.n_types), args.exp_decay))
        learner.fit(timestamps)

    print(learner.baseline)
    print(learner.adjacency)
Esempio n. 2
0
                results[metric_name] = eval_fns[metric_name](A_true, A_pred)

    # export evaluation results
    time = pd.Timestamp.now()
    df = pd.DataFrame(
        columns=[
            "timestamp",
            "dataset",
            "split_id",
            "model",
            "metric",
            "value",
            "config",
        ]
    )

    for metric_name, val in results.items():

        df.loc[len(df)] = (
            time,
            args.dataset,
            args.split_id,
            args.model,
            metric_name,
            val,
            vars(args),
        )

    logger.info(df)
    export_csv(df, osp.join(args.output_dir, "results.csv"), append=True)