Exemplo n.º 1
0
def do_run_experiment(source, experiment_id, config_file):
    source_output_dir = 'test_outputs'
    experiment_dir = join(source_output_dir, source)

    # remove all previously created files
    for output_subdir in ['output', 'figure', 'report']:
        files = glob(join(source_output_dir, source, output_subdir, '*'))
        for f in files:
            remove(f)
    run_experiment(config_file, experiment_dir)
def test_same_id_linear_then_non_linear_raises_error():

    experiment_path = join(rsmtool_test_dir, "data", "experiments", "lr")
    configpath = join(experiment_path, "lr.json")
    configdict = json.load(open(configpath, "r"))

    output_dir = "test_outputs/same-id-different-model"
    config = Configuration(configdict, configdir=experiment_path)
    run_experiment(config, output_dir, overwrite_output=True)

    config['model'] = "SVC"
    run_experiment(config, output_dir, overwrite_output=True)
Exemplo n.º 3
0
def do_run_experiment(source, experiment_id, config_file):
    """
    Run RSMTool experiment using the given experiment
    configuration file located in the given source directory
    and using the given experiment ID.

    Parameters
    ----------
    source : str
        Path to where the test is located on disk.
    experiment_id : str
        Experiment ID to use when running.
    config_file : str
        Path to the experiment configuration file.
    """
    source_output_dir = 'test_outputs'
    experiment_dir = join(source_output_dir, source)

    # remove all previously created files
    for output_subdir in ['output', 'figure', 'report']:
        files = glob(join(source_output_dir, source, output_subdir, '*'))
        for f in files:
            remove(f)
    run_experiment(config_file, experiment_dir)
Exemplo n.º 4
0
def test_run_experiment_wrong_input_format():
    config_list = [('experiment_id', 'AAAA'),
                   ('train_file', 'some_path')]
    with tempfile.TemporaryDirectory() as temp_dir:
        run_experiment(config_list, temp_dir)