Spaces:
Runtime error
Runtime error
Fix leaderboard domain and dataset deduplication
Browse files82 unmodified lines8384858687888990919293949596979899100101102103104105106107108109110111112113114115116117115 unmodified lines23323423523623723823924058 unmodified lines299300301271272302303304305306307308212 unmodified lines52152252349149249349449549649749849950050150250352452552614 unmodified lines54154254352454454554654754854955055155255355455555655755855956056156256337 unmodified lines6016026035685695705715725735745755766046056066072 unmodified lines610611612613614615616617618619620621300 unmodified lines92292392489292592692789692892993082 unmodified lines "num_variates",]
CANONICAL_DOMAINS = [ "Finance", "Climate", "Ocean", "Hydrology", "Transportation", "Web", "Hazards",]
DOMAIN_DISPLAY = { "Finance": "Finance", "Econ/Fin": "Finance", "Sales": "Finance", "Climate": "Climate", "Weather": "Climate", "Air Quality": "Climate", "Nature": "Climate", "Energy": "Climate", "Ocean": "Ocean", "Hydrology": "Hydrology", "Transport": "Transportation", "Transportation": "Transportation", "Web": "Web", "Web/CloudOps": "Web", "Hazards": "Hazards", "Healthcare": "Hazards",}
def _read_result_csv(path: str | Path) -> pd.DataFrame: df = pd.read_csv(115 unmodified lines return df if Path(ds_properties).exists(): df = enrich_with_properties(df, ds_properties) if "domain" in df.columns: df["domain"] = df["domain"].map(display_domain)
for metric in METRIC_COLUMNS: df[metric] = pd.to_numeric(df[metric], errors="coerce")58 unmodified lines subset = df[df["dataset"] == dataset] if subset.empty: continue values = subset.set_index("model")[DISPLAY_METRICS].rename(columns=METRIC_LABELS) ranks = subset.set_index("model")[rank_cols].rename( values = subset.groupby("model")[DISPLAY_METRICS].agg(aggregate_gmean).rename( columns=METRIC_LABELS ) ranks = subset.groupby("model")[rank_cols].agg(aggregate_rank_mean).rename( columns={f"Rank_{metric}": f"{METRIC_LABELS[metric]}_Rank" for metric in DISPLAY_METRICS} ) dataset_values[dataset] = values212 unmodified lines f"{generated}." )
DOMAIN_DISPLAY = { "Weather": "Climate", "Air Quality": "Climate", "Transport": "Transport", "Transportation": "Transportation", "Finance": "Finance", "Ocean": "Ocean", "Hydrology": "Hydrology", "Hazards": "Hazards", "Web": "Web",}
DATASET_SHORT_NAMES = { "binance_btcusdt_1h_close": "BTC/USDT", "coingecko_bitcoin_7d_price_usd": "Bitcoin USD",14 unmodified lines
def display_domain(raw_domain: str) -> str: return DOMAIN_DISPLAY.get(raw_domain, raw_domain) domain = str(raw_domain).strip() if domain in DOMAIN_DISPLAY: return DOMAIN_DISPLAY[domain] lowered = domain.lower() if any(token in lowered for token in ("finance", "econ", "sales")): return "Finance" if any(token in lowered for token in ("climate", "weather", "air", "nature", "energy")): return "Climate" if "ocean" in lowered: return "Ocean" if "hydro" in lowered: return "Hydrology" if any(token in lowered for token in ("transport", "taxi")): return "Transportation" if any(token in lowered for token in ("web", "cloud", "wiki")): return "Web" return "Hazards"
def dataset_short_name(dataset: str) -> str:37 unmodified lines
DOMAIN_TAB_ORDER = [ "Finance", "Climate", "Ocean", "Hydrology", "Transport", "Transportation", "Hazards", "Web", "Other", *CANONICAL_DOMAINS,]
2 unmodified lines root_dir: str = "results",) -> dict[str, list[str]]: by_domain: dict[str, list[str]] = {} seen: set[str] = set() for dataset in datasets: dataset = dataset.split("/")[0].strip() if dataset in seen: continue seen.add(dataset) domain = display_domain(lookup_dataset_domain(dataset, root_dir)) by_domain.setdefault(domain, []).append(dataset)
300 unmodified lines "Climate": "#60a5fa", "Ocean": "#34d399", "Hydrology": "#818cf8", "Transport": "#fbbf24", "Transportation": "#14b8a6", "Hazards": "#fb7185", "Web": "#a78bfa", "Other": "#94a3b8",}
src/utils.py+58-27