''' Settings nested cross-validation. '''
K_range = [1,2,3,4,5,6,7]
no_folds = 5
no_threads = 5
parallel = False
folder_results = './results/gaussian_gaussian_ard/'
output_file = folder_results+'results.txt'
files_nested_performances = [folder_results+'fold_%s.txt'%(fold+1) for fold in range(no_folds)]


''' Construct the parameter search. '''
parameter_search = [{'K':K, 'hyperparameters':hyperparameters} for K in K_range]


''' Run the cross-validation framework. '''
nested_crossval = MatrixNestedCrossValidation(
    method=method,
    R=R,
    M=M,
    K=no_folds,
    P=no_threads,
    parameter_search=parameter_search,
    train_config=train_config,
    predict_config=predict_config,
    file_performance=output_file,
    files_nested_performances=files_nested_performances,
)
nested_crossval.run(parallel=parallel)
}
''' Settings nested cross-validation. '''
K_range = [1, 2, 3, 4, 5, 6, 7]
no_folds = 5
no_threads = 5
parallel = False
folder_results = './results/gaussian_laplace_ig/'
output_file = folder_results + 'results.txt'
files_nested_performances = [
    folder_results + 'fold_%s.txt' % (fold + 1) for fold in range(no_folds)
]
''' Construct the parameter search. '''
parameter_search = [{
    'K': K,
    'hyperparameters': hyperparameters
} for K in K_range]
''' Run the cross-validation framework. '''
nested_crossval = MatrixNestedCrossValidation(
    method=method,
    R=R,
    M=M,
    K=no_folds,
    P=no_threads,
    parameter_search=parameter_search,
    train_config=train_config,
    predict_config=predict_config,
    file_performance=output_file,
    files_nested_performances=files_nested_performances,
)
nested_crossval.run(parallel=parallel)
''' Settings nested cross-validation. '''
K_range = [3,4,5,6,7]
no_folds = 5
no_threads = 5
stratify_rows = False
parallel = False
folder_results = './results/gaussian_exponential_ard/'
output_file = folder_results+'results.txt'
files_nested_performances = [folder_results+'fold_%s.txt'%(fold+1) for fold in range(no_folds)]


''' Construct the parameter search. '''
parameter_search = [{'K':K, 'hyperparameters':hyperparameters} for K in K_range]


''' Run the cross-validation framework. '''
nested_crossval = MatrixNestedCrossValidation(
    method=method,
    R=R,
    M=M,
    K=no_folds,
    P=no_threads,
    parameter_search=parameter_search,
    train_config=train_config,
    predict_config=predict_config,
    file_performance=output_file,
    files_nested_performances=files_nested_performances,
)
nested_crossval.run(parallel=parallel, stratify_rows=stratify_rows)
示例#4
0
''' Settings nested cross-validation. '''
K_range = [3,4,5,6,7]
no_folds = 5
no_threads = 5
stratify_rows = False
parallel = False
folder_results = './results/gaussian_gaussian_exponential/'
output_file = folder_results+'results.txt'
files_nested_performances = [folder_results+'fold_%s.txt'%(fold+1) for fold in range(no_folds)]


''' Construct the parameter search. '''
parameter_search = [{'K':K, 'hyperparameters':hyperparameters} for K in K_range]


''' Run the cross-validation framework. '''
nested_crossval = MatrixNestedCrossValidation(
    method=method,
    R=R,
    M=M,
    K=no_folds,
    P=no_threads,
    parameter_search=parameter_search,
    train_config=train_config,
    predict_config=predict_config,
    file_performance=output_file,
    files_nested_performances=files_nested_performances,
)
nested_crossval.run(parallel=parallel, stratify_rows=stratify_rows)