本文整理汇总了Python中BMF_Priors.code.cross_validation.nested_matrix_cross_validation.MatrixNestedCrossValidation类的典型用法代码示例。如果您正苦于以下问题:Python MatrixNestedCrossValidation类的具体用法?Python MatrixNestedCrossValidation怎么用?Python MatrixNestedCrossValidation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MatrixNestedCrossValidation类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
}
''' 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)
示例2: range
''' 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)