| 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 as e: | |
| return "n/a" | |
| for framework in frameworks: | |
| data.update({framework: [mean(dataset, framework) for dataset in datasets]}) | |
| df = pd.DataFrame(data=data) | |
| table = df.to_markdown(index=False) | |
| with gr.Blocks() as demo: | |
| gr.Markdown( | |
| f""" | |
| # Time Series Forecasting Leaderboard | |
| This is a leaderboard of the 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.Markdown(table) | |
| if __name__ == "__main__": | |
| demo.launch() | |