import gradio as gr import pandas as pd mase = pd.read_csv("results/results_mase.csv") datasets = mase.dataset.unique() frameworks = mase.framework.unique() mase.set_index(["dataset", "framework"], inplace=True) data = {"Dataset": datasets} def mean(data, framework): try: return f"{round(mase.loc[data, framework].metric_error.mean(),3)} +/- {round(mase.loc[data, framework].metric_error.std(),3)}" except KeyError: return "n/a" for framework in frameworks: data.update({framework: [mean(dataset, framework) for dataset in datasets]}) df = pd.DataFrame(data=data) with gr.Blocks() as demo: gr.Markdown( """ # Time Series Forecasting Leaderboard This is a leaderboard of the [MASE](https://huggingface.co/spaces/evaluate-metric/mase) metric for time series forecasting problem on the different open datasets and models. The table is generated from the paper [AutoGluon–TimeSeries: AutoML for Probabilistic Time Series Forecasting](https://github.com/autogluon/autogluon) by Oleksandr Shchur, Caner Turkmen, Nick Erickson, Huibin Shen, Alexander Shirkov, Tony Hu, and Bernie Wang. ## MASE Metric """ ) gr.Dataframe(df) if __name__ == "__main__": demo.launch()