CommencerCommencer gratuitement

Transforming backtesting output

Once backtesting is complete, you will need to transform the data in order to effectively evaluate the results and choose the best-performing model.

Cet exercice fait partie du cours

Designing Forecasting Pipelines for Production

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

models = list(ml_models.keys())  

bkt_long = pd.melt(
    bkt_df,
    id_vars=["unique_id", "ds", "cutoff", "y"],
  	# Complete two f-strings
    value_vars=models + [f"{____}-lo-95" for model in models] + [f"{____}-hi-95" for model in models],
    var_name="model_label", 
    value_name="value")

print(bkt_long.head())
Modifier et exécuter le code