当前位置: 首页>>代码示例>>Python>>正文


Python MatrixNestedCrossValidation.run方法代码示例

本文整理汇总了Python中BMF_Priors.code.cross_validation.nested_matrix_cross_validation.MatrixNestedCrossValidation.run方法的典型用法代码示例。如果您正苦于以下问题:Python MatrixNestedCrossValidation.run方法的具体用法?Python MatrixNestedCrossValidation.run怎么用?Python MatrixNestedCrossValidation.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BMF_Priors.code.cross_validation.nested_matrix_cross_validation.MatrixNestedCrossValidation的用法示例。


在下文中一共展示了MatrixNestedCrossValidation.run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: range

# 需要导入模块: from BMF_Priors.code.cross_validation.nested_matrix_cross_validation import MatrixNestedCrossValidation [as 别名]
# 或者: from BMF_Priors.code.cross_validation.nested_matrix_cross_validation.MatrixNestedCrossValidation import run [as 别名]

''' 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)
开发者ID:changchunli,项目名称:BMF_Priors,代码行数:31,代码来源:gaussian_gaussian_ard.py

示例2: range

# 需要导入模块: from BMF_Priors.code.cross_validation.nested_matrix_cross_validation import MatrixNestedCrossValidation [as 别名]
# 或者: from BMF_Priors.code.cross_validation.nested_matrix_cross_validation.MatrixNestedCrossValidation import run [as 别名]
''' 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)
开发者ID:changchunli,项目名称:BMF_Priors,代码行数:31,代码来源:gaussian_exponential_ard.py


注:本文中的BMF_Priors.code.cross_validation.nested_matrix_cross_validation.MatrixNestedCrossValidation.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。