write_regression_results¶
- tsml_eval.utils.results_writing.write_regression_results(predictions, labels, regressor_name, dataset_name, file_path, full_path=True, split=None, resample_id=None, time_unit='N/A', first_line_comment=None, parameter_info='No Parameter Info', mse=-1, fit_time=-1, predict_time=-1, benchmark_time=-1, memory_usage=-1, train_estimate_method='', train_estimate_time=-1, fit_and_estimate_time=-1)[source]¶
Write the predictions for a regression experiment in the format used by tsml.
- Parameters:
- predictionsnp.array
The predicted values to write to file. Must be the same length as labels.
- labelsnp.array
The actual label values written to file with the predicted values.
- regressor_namestr
Name of the regressor that made the predictions. Written to file and can determine file structure if full_path is False.
- dataset_namestr
Name of the problem the regressor was built on.
- file_pathstr
Path to write the results file to or the directory to build the default file structure if full_path is False.
- full_pathboolean, default=True
If True, results are written directly to the directory passed in file_path. If False, then a standard file structure using the regressor and dataset names is created and used to write the results file.
- splitstr or None, default=None
Either None, ‘TRAIN’ or ‘TEST’. Influences the result file name and first line of the file.
- resample_idint or None, default=None
Indicates what random seed was used to resample the data or used as a random_state for the regressor.
- time_unitstr, default=”N/A”
The format used for timings in the file, i.e. ‘Seconds’, ‘Milliseconds’, ‘Nanoseconds’
- first_line_commentstr or None, default=None
Optional comment appended to the end of the first line, i.e. the file used to generate the results.
- parameter_infostr, default=”No Parameter Info”
Unstructured estimator dependant information, i.e. estimator parameters or values from the model build.
- mse: float, default=-1
The mean squared error of the predictions.
- fit_timeint, default=-1
The time taken to fit the regressor.
- predict_timeint, default=-1
The time taken to predict the regression labels.
- benchmark_timeint, default=-1
A benchmark time for the hardware used to scale other timings.
- memory_usageint, default=-1
The memory usage of the regressor.
- train_estimate_methodstr, default=””
The method used to generate predictions for results on training data.
- train_estimate_timeint, default=-1
The time taken to generate predictions for results on training data.
- fit_and_estimate_timeint, default=-1
The time taken to fit the regressor to build and generate predictions for results on training data.
This is not necessarily always going to be fit_time + train_estimate_time, i.e. if an estimate requires the model to be fit, fit_time would be included in the train_estimate_time value. In this case fit_time + train_estimate_time would time fitting the model twice.