gretapy.tl.ranking

Contents

gretapy.tl.ranking#

gretapy.tl.ranking(df, metric_weights=None)#

Compute the weighted mean F0.1 per method that determines the ranking.

For each dataset, metric scores are aggregated to the class level (averaging over db then task) and combined across metric classes using a weighted mean. The final score is the mean of these per-dataset weighted means across datasets.

Parameters:
  • df (pandas.DataFrame) – Metrics dataframe with columns: class, task, db, dataset, name, f01.

  • metric_weights (dict or None) – Weight for each metric class. Keys are class names (predictive, genomic, literature, mechanistic); all must be non-negative. Any metric class missing from the dictionary is treated as having a weight of 0 (i.e. excluded from the ranking). Defaults to dict(predictive=1, genomic=1, literature=1, mechanistic=1). Within each dataset the weighted mean is the sum of weight * value divided by the total of the weights of the classes present in that dataset; these per-dataset values are then averaged across datasets.

Returns:

pandas.DataFrame DataFrame indexed by method name (name). The first column mean_f01 holds the overall weighted mean F0.1 (averaged across datasets), followed by one column per dataset holding that dataset’s weighted mean F0.1. Rows are sorted by mean_f01 in descending order.