load_and_run_classification_experiment

tsml_eval.experiments.load_and_run_classification_experiment(problem_path, results_path, dataset, classifier, classifier_name=None, resample_id=0, data_transforms=None, build_train_file=False, write_attributes=False, att_max_shape=0, benchmark_time=True, overwrite=False, predefined_resample=False)[source]

Load a dataset and run a classification experiment.

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

Parameters:
problem_pathstr

Location of problem files, full path.

results_pathstr

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

datasetstr

Name of problem. Files must be <problem_path>/<dataset>/<dataset>+”_TRAIN.ts”, same for “_TEST.ts”.

classifierBaseClassifier

Classifier to be used in the experiment.

classifier_namestr or None, default=None

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

resample_idint, default=0

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_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 classifier can produce its own estimates, those are used instead.

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.

overwritebool, default=False

If set to False, this will only build results if there is not a result file already present. If True, it will overwrite anything already there.

predefined_resamplebool, default=False

Read a predefined resample from file instead of performing a resample. If True the file format must include the resample_id at the end of the dataset name i.e. <problem_path>/<dataset>/<dataset>+<resample_id>+”_TRAIN.ts”.