# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Reproducing stance detection - UKP dataset

# +
import mlflow
import pandas as pd

mlflow.set_tracking_uri('http://localhost:5000')
# -

# ## In-topic

runs = mlflow.search_runs(run_view_type=mlflow.tracking.client.ViewType.ACTIVE_ONLY, 
                          experiment_ids=[2, 4])

runs.groupby('params.task_name')['metrics.test_acc'].max().reset_index()

# ## Cross-topic

runs = mlflow.search_runs(run_view_type=mlflow.tracking.client.ViewType.ACTIVE_ONLY, 
                          experiment_ids=[6, 7])

cross_topic = runs.groupby(['params.task_name', 'params.test_id'])['metrics.test_acc'].max().unstack()
cross_topic['mean'] = cross_topic.values.mean(axis=1)
cross_topic

# # REVIEWS dataset

runs = mlflow.search_runs(run_view_type=mlflow.tracking.client.ViewType.ACTIVE_ONLY, 
                          experiment_ids=[3, 8])

runs.groupby('params.task_name')['metrics.test_acc', 'metrics.test_f1_macro'].max().reset_index()



StarcoderdataJupyterScriptsDedupFiltered