RegressorResults

tsml_eval.evaluation.storage.RegressorResults(dataset_name='N/A', regressor_name='N/A', split='N/A', resample_id=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, error_estimate_method='N/A', error_estimate_time=-1.0, build_plus_estimate_time=-1.0, target_labels=None, predictions=None, pred_times=None, pred_descriptions=None)[source]

A class for storing and managing results from regression experiments.

This class provides functionalities for storing regressor 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.

regressor_namestr, default=”N/A”

Name of the regressor used.

splitstr, default=”N/A”

Type of data split used, i.e. “train” or “test”.

resample_idint or None, default=None

Random seed used for the data resample, with 0 usually being the original data.

time_unitstr, default=”nanoseconds”

Time measurement used for other fields.

descriptionstr, default=””

Additional description of the regression experiment. Appended to the end of the first line of the results file.

parametersstr, default=”No parameter info”

Information about parameters used in the regressor 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.

error_estimate_methodstr, default=”N/A”

Method used for train error/accuracy estimation (i.e. 10-fold CV, OOB error).

error_estimate_timefloat, default=-1.0

Time taken for train error/accuracy estimation.

build_plus_estimate_timefloat, default=-1.0

Total time for building the regressor and estimating error/accuracy on the train set. For certain methods this can be different from the sum of fit_time and error_estimate_time.

target_labelsarray-like or None, default=None

Actual target labels.

predictionsarray-like or None, default=None

Predicted class 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.

Attributes:
n_casesint or None

Number of cases in the dataset.

mean_squared_errorfloat or None

Mean squared error of the predictions.

root_mean_squared_errorfloat or None

Root mean squared error of the predictions.

mean_absolute_errorfloat or None

Mean absolute error of the predictions.

r2_scorefloat or None

R2 score of the predictions.

mean_absolute_percentage_errorfloat or None

Mean absolute percentage error of the predictions.

Examples

>>> from tsml_eval.evaluation.storage import RegressorResults
>>> from tsml_eval.testing.testing_utils import _TEST_RESULTS_PATH
>>> rr = RegressorResults().load_from_file(
...     _TEST_RESULTS_PATH +
...     "/regression/ROCKET/Predictions/Covid3Month/testResample0.csv"
... )
>>> rr.calculate_statistics()
>>> mse = rr.mean_squared_error