olpy.run_experiments
- olpy.run_experiments(train_file, test_file, models, n_iterations=1, label='Label', bias=False, use_weights=False, weights=None, cv=False, model_dir=None, verbose=False, output_file=None, seed=None)[source]
Run an experiment using the data passed by the user.
Given the parameters passed by the user, this function executes an experiment and reports the results to the user at the specified destination(files and/or console).
- Parameters
train_file (
str) – path to the training dataset file.test_file (
str) – path to the testing dataset file.models (
list) – a list of models to try out.n_iterations (
int, optional) – number of iterations to run each model for. Defaults to 1.label (
str, optional) – the column index of the output variable. Defaults to ‘Label’.bias (
bool, optional) – whether a bias should be used or not. Defaults to False.use_weights (
bool, optional) – whether weights should be used while training the models. Defaults to False.weights (
numpy.ndarray, optional) – an array representing the weights to use during the training process. This only works when use_weights is set to True.cv (
bool, optional) – whether cross validation will be ran or not. Defaults to True.model_dir (
str, optional) – the directory to which the dumps of the models will be saved. Defaults to None.verbose (
bool, optional) – whether the program should produce output or not. Defaults to False.output_file (
str) – path to the output file if any.seed (
int, optional) – random-generator seed. Defaults to None.
- Returns
None
- Raises
FileNotFoundError – if one of the files passed does not exist
IndexError – if the specified label does not exist in the data.