utilsforecast.losses
mae
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.mse
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.rmse
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.bias
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.cfe
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.pis
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.spis
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.mape
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.smape
df
(pandas or polars DataFrame): Input dataframe with id, actual values and predictions.models
(list of str): Columns that identify the models predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.mase
df
(pandas or polars DataFrame): Input dataframe with id, actuals and predictions.models
(list of str): Columns that identify the models predictions.seasonality
(int): Main frequency of the time series; Hourly 24, Daily 7, Weekly 52, Monthly 12, Quarterly 4, Yearly 1.train_df
(pandas or polars DataFrame): Training dataframe with id and actual values. Must be sorted by time.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.[1] https
: //robjhyndman.com/papers/mase.pdfrmae
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(list of str): Columns that identify the models predictions.baseline
(str): Column that identifies the baseline model predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.nd
df
: Input dataframe with id, times, actuals and predictions.models
: Columns that identify the models predictions.id_col
: Column that identifies each serie. Defaults to ‘unique_id’.target_col
: Column that contains the target. Defaults to ‘y’.msse
df
(pandas or polars DataFrame): Input dataframe with id, actuals and predictions.models
(list of str): Columns that identify the models predictions.seasonality
(int): Main frequency of the time series; Hourly 24, Daily 7, Weekly 52, Monthly 12, Quarterly 4, Yearly 1.train_df
(pandas or polars DataFrame): Training dataframe with id and actual values. Must be sorted by time.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.[1] https
: //otexts.com/fpp3/accuracy.htmlrmsse
df
(pandas or polars DataFrame): Input dataframe with id, actuals and predictions.models
(list of str): Columns that identify the models predictions.seasonality
(int): Main frequency of the time series; Hourly 24, Daily 7, Weekly 52, Monthly 12, Quarterly 4, Yearly 1.train_df
(pandas or polars DataFrame): Training dataframe with id and actual values. Must be sorted by time.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.[1] https
: //otexts.com/fpp3/accuracy.htmlquantile_loss
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(dict from str to str): Mapping from model name to the model predictions for the specified quantile.q
(float, optional): Quantile for the predictions’ comparison. Defaults to 0.5.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.scaled_quantile_loss
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(dict from str to str): Mapping from model name to the model predictions for the specified quantile.seasonality
(int): Main frequency of the time series; Hourly 24, Daily 7, Weekly 52, Monthly 12, Quarterly 4, Yearly 1.train_df
(pandas or polars DataFrame): Training dataframe with id and actual values. Must be sorted by time.q
(float, optional): Quantile for the predictions’ comparison. Defaults to 0.5.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.mqloss
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(dict from str to list of str): Mapping from model name to the model predictions for each quantile.quantiles
(numpy array): Quantiles to compare against.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.[1] https
: //www.jstor.org/stable/2629907scaled_mqloss
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(dict from str to list of str): Mapping from model name to the model predictions for each quantile.quantiles
(numpy array): Quantiles to compare against.seasonality
(int): Main frequency of the time series; Hourly 24, Daily 7, Weekly 52, Monthly 12, Quarterly 4, Yearly 1.train_df
(pandas or polars DataFrame): Training dataframe with id and actual values. Must be sorted by time.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.coverage
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(list of str): Columns that identify the models predictions.level
(int): Confidence level used for intervals.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.[1] https
: //www.jstor.org/stable/2629907calibration
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(dict from str to str): Mapping from model name to the model predictions.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.[1] https
: //www.jstor.org/stable/2629907scaled_crps
y_hat
compared to the observation y
. This metric averages percentual weighted absolute deviations as defined by the quantile losses.
Args:
df
(pandas or polars DataFrame): Input dataframe with id, times, actuals and predictions.models
(dict from str to list of str): Mapping from model name to the model predictions for each quantile.quantiles
(numpy array): Quantiles to compare against.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: dataframe with one row per id and one column per model.[1] https
: //proceedings.mlr.press/v139/rangapuram21a.htmltweedie_deviance
power
parameter defines the specific compound distribution:
2: Inverse Gaussian
df
(pandas or polars DataFrame): Input dataframe with id, actuals and predictions.models
(list of str): Columns that identify the models predictions.power
(float, optional): Tweedie power parameter. Determines the compound distribution. Defaults to 1.5.id_col
(str, optional): Column that identifies each serie. Defaults to ‘unique_id’.target_col
(str, optional): Column that contains the target. Defaults to ‘y’.pandas or polars DataFrame
: DataFrame with one row per id and one column per model, containing the mean Tweedie deviance.[1] https
: //en.wikipedia.org/wiki/Tweedie_distribution