run_regression_experiment

tsml_eval.experiments.run_regression_experiment(X_train: ndarray | list, y_train: ndarray, X_test: ndarray | list, y_test: ndarray, regressor, results_path, regressor_name=None, dataset_name='', resample_id=None, data_transforms=None, build_test_file=True, build_train_file=False, ignore_custom_train_estimate=False, attribute_file_path=None, att_max_shape=0, benchmark_time=True)[source]

Run a regression experiment and save the results to file.

Function to run a basic regression experiment for a <dataset>/<regressor>/<resample> combination and write the results to csv file(s) at a given location.

Parameters:
X_trainnp.ndarray or list of np.ndarray

The data to train the classifier. Numpy array or list of numpy arrays in the aeon data format.

y_trainnp.array

Training data class labels. One label per case in the training data using the same ordering.

X_testnp.ndarray or list of np.ndarray

The data used to test the trained classifier. Numpy array or list of numpy arrays in the aeon data format.

y_testnp.array

Testing data class labels. One label per case in the testing data using the same ordering.

regressorBaseRegressor

Regressor to be used in the experiment.

results_pathstr

Location of where to write results. Any required directories will be created.

regressor_namestr or None, default=None

Name of regressor used in writing results. If None, the name is taken from the regressor.

dataset_namestr, default=”N/A”

Name of dataset.

resample_idint or None, default=None

Seed for resampling. If set to 0, the default train/test split from file is used. Also used in output file name.

data_transformstransformer, list of transformers or None, default=None

Transformer(s) to apply to the data before running the experiment. If a list, the transformers are applied in order. If None, no transformation is applied. Calls fit_transform on the training data and transform on the test data.

build_test_filebool, default=True:

Whether to generate test files or not. If the regressor can generate its own train predictions, the classifier will be built but no file will be output.

build_train_filebool, default=False

Whether to generate train files or not. If true, it performs a 10-fold cross-validation on the train data and saves. If the regressor can produce its own estimates, those are used instead.

ignore_custom_train_estimatebool, default=False

todo

attribute_file_pathstr or None, default=None

todo (only test)

att_max_shapeint, default=0

todo

benchmark_timebool, default=True

Whether to benchmark the hardware used with a simple function and write the results. This will typically take ~2 seconds, but is hardware dependent.