ForecasterResults¶
- tsml_eval.evaluation.storage.ForecasterResults(dataset_name='N/A', forecaster_name='N/A', split='N/A', random_seed=None, time_unit='nanoseconds', description='', parameters='No parameter info', fit_time=-1.0, predict_time=-1.0, benchmark_time=-1.0, memory_usage=-1.0, target_labels=None, predictions=None, pred_times=None, pred_descriptions=None)[source]¶
A class for storing and managing results from forecasting experiments.
This class provides functionalities for storing forecaster results, including predictions, probabilities, and various performance metrics. It extends the EstimatorResults class, inheriting its base functionalities.
- Parameters:
- dataset_namestr, default=”N/A”
Name of the dataset used.
- forecaster_namestr, default=”N/A”
Name of the forecaster used.
- splitstr, default=”N/A”
Type of data split used, i.e. “train” or “test”.
- random_seedint or None, default=None
Random seed used.
- time_unitstr, default=”nanoseconds”
Time measurement used for other fields.
- descriptionstr, default=””
Additional description of the forecasting experiment. Appended to the end of the first line of the results file.
- parametersstr, default=”No parameter info”
Information about parameters used in the forecaster and other build information. Written to the second line of the results file.
- fit_timefloat, default=-1.0
Time taken fitting the model.
- predict_timefloat, default=-1.0
Time taken making predictions.
- benchmark_timefloat, default=-1.0
Time taken to run a simple benchmark function. In tsml-eval experiments, this is the time spent to sort 1,000 (seeded) random numpy arrays of size 20,000.
- memory_usagefloat, default=-1.0
Memory usage during the experiment. In tsml-eval experiments, this is the peak memory usage during the fit method.
- target_labelsarray-like or None, default=None
Actual target labels.
- predictionsarray-like or None, default=None
Predicted target labels.
- pred_timesarray-like or None, default=None
Prediction times for each case.
- pred_descriptionslist of str or None, default=None
Descriptions for each prediction.
Examples
>>> from tsml_eval.evaluation.storage import ForecasterResults >>> from tsml_eval.testing.testing_utils import _TEST_RESULTS_PATH >>> fr = ForecasterResults().load_from_file( ... _TEST_RESULTS_PATH + ... "/forecasting/NaiveForecaster/Predictions/Airline/testResample0.csv" ... ) >>> fr.calculate_statistics() >>> fr.mean_absolute_percentage_error 0.19886711926999853
- Attributes:
- mean_absolute_percentage_errorfloat or None
Mean absolute percentage error of the predictions.