run_classification_experiment

tsml_eval.experiments.run_classification_experiment(X_train, y_train, X_test, y_test, classifier, results_path, row_normalise=False, classifier_name=None, dataset_name='N/A', resample_id=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 classification experiment and save the results to file.

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

Parameters:
X_trainpd.DataFrame or np.array todo

The data to train the classifier.

y_trainnp.array

Training data class labels.

X_testpd.DataFrame or np.array

The data used to test the trained classifier.

y_testnp.array

Testing data class labels.

classifierBaseClassifier

Classifier to be used in the experiment.

results_pathstr

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

row_normalisebool, default=False

Whether to normalise the data rows (time series) prior to fitting and predicting.

classifier_namestr or None, default=None

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

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.

build_test_filebool, default=True:

Whether to generate test files or not. If the classifier can generate its own train probabilities, 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 classifier 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.