Skip to content

evaluation

rank_fva(y_true, y_pred, y_pred_bench=None, scoring=None, descending=False)

Sorts point forecasts in y_pred across entities / time-series by score.

Parameters:

Name Type Description Default
y_true DataFrame

Panel DataFrame of observed values.

required
y_pred DataFrame

Panel DataFrame of point forecasts.

required
y_pred_bench DataFrame

Panel DataFrame of benchmark forecast values.

None
scoring Optional[metric]

If None, defaults to SMAPE.

None
descending bool

Sort in descending order. Defaults to False.

False

Returns:

Name Type Description
ranks DataFrame

Cross-sectional DataFrame with two columns: entity name and score.

rank_point_forecasts(y_true, y_pred, sort_by='smape', descending=False)

Sorts point forecasts in y_pred across entities / time-series by score.

Parameters:

Name Type Description Default
y_true DataFrame

Panel DataFrame of observed values.

required
y_pred DataFrame

Panel DataFrame of point forecasts.

required
sort_by str

Metric name.

'smape'
descending bool

Sort in descending order. Defaults to False.

False

Returns:

Name Type Description
ranks DataFrame

Cross-sectional DataFrame with two columns: entity name and score.

rank_residuals(y_resids, sort_by='abs_bias', alpha=0.05, descending=False)

Sorts point forecasts in y_pred across entities / time-series by score.

Parameters:

Name Type Description Default
y_resids DataFrame

Panel DataFrame of residuals by splits.

required
sort_by str

Method to sort residuals by: bias, abs_bias (absolute bias), normality (via skew and kurtosis tests), or autocorr (Ljung-box test for lag = 1). Defaults to abs_bias.

'abs_bias'
max_lags int

Number of lags to test.

required
alpha float

To compute (1.0 - alpha) confidence interval.

0.05
descending bool

Sort in descending order. Defaults to False.

False

Returns:

Name Type Description
ranks DataFrame

Cross-sectional DataFrame with two columns: entity name and score.