TimeSeriesPredictor.evaluate#
- TimeSeriesPredictor.evaluate(data: Union[TimeSeriesDataFrame, DataFrame], **kwargs)[source]#
Evaluate the performance for given dataset, computing the score determined by
self.eval_metric
on the given data set, and with the sameprediction_length
used when training models.- Parameters
data (Union[TimeSeriesDataFrame, pd.DataFrame]) –
The data to evaluate the best model on. The last
prediction_length
time steps of the data set, for each item, will be held out for prediction and forecast accuracy will be calculated on these time steps.If
known_covariates_names
were specified when creating the predictor,data
must include the columns listed inknown_covariates_names
with the covariates values aligned with the target time series.If
train_data
used to train the predictor contained past covariates or static features, thendata
must also include them (with same column names and dtypes).If provided data is an instance of pandas DataFrame, AutoGluon will attempt to automatically convert it to a
TimeSeriesDataFrame
.model (str, optional) – Name of the model that you would like to evaluate. By default, the best model during training (with highest validation score) will be used.
metric (str, optional) – Name of the evaluation metric to compute scores with. Defaults to
self.eval_metric
use_cache (bool, default = True) – If True, will attempt to use the cached predictions. If False, cached predictions will be ignored. This argument is ignored if
cache_predictions
was set to False when creating theTimeSeriesPredictor
.
- Returns
score – A forecast accuracy score, where higher values indicate better quality. For consistency, error metrics will have their signs flipped to obey this convention. For example, negative MAPE values will be reported.
- Return type
float