run_classification_experiment#
- run_classification_experiment(X_train, y_train, X_test, y_test, classifier, results_path, cls_name='', dataset='', resample_id=0, train_file=False, test_file=True)[source]#
Run a classification experiment and save the results to file.
Method to run a basic experiment and write the results to files called testFold<resampleID>.csv and, if required, trainFold<resampleID>.csv.
- Parameters:
- X_trainpd.DataFrame or np.array
The data to train the classifier.
- y_trainnp.array, default = None
Training data class labels.
- X_testpd.DataFrame or np.array, default = None
The data used to test the trained classifier.
- y_testnp.array, default = None
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.
- cls_namestr, default=””
Name of the classifier.
- datasetstr, default=””
Name of problem.
- 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.
- 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.
- 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.