示例#1
0
output_file = "./results.txt"

alpha, beta = 1., 1.
lambdaF = 1. / 10.
lambdaS = 1. / 10.
lambdaG = 1. / 10.
priors = {
    'alpha': alpha,
    'beta': beta,
    'lambdaF': lambdaF,
    'lambdaS': lambdaS,
    'lambdaG': lambdaG
}

# Load in the CCLE EC50 dataset
R, M = load_ccle(ic50=False)

# Run the cross-validation framework
#random.seed(1)
#numpy.random.seed(1)
nested_crossval = GreedySearchCrossValidation(classifier=bnmtf_gibbs_optimised,
                                              R=R,
                                              M=M,
                                              values_K=K_range,
                                              values_L=L_range,
                                              folds=no_folds,
                                              priors=priors,
                                              init_S=init_S,
                                              init_FG=init_FG,
                                              iterations=iterations,
                                              restarts=restarts,
示例#2
0
    'init_UV': 'exponential',
    'expo_prior': 0.1
}
K_range = [1, 2, 3]
no_threads = 2
no_folds = 10
output_file = "./results.txt"
files_nested_performances = [
    "./fold_%s.txt" % fold for fold in range(1, no_folds + 1)
]

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

# Load in the CCLE IC50 dataset
R, M = load_ccle(ic50=True)

# Run the cross-validation framework
#random.seed(42)
#numpy.random.seed(9000)
nested_crossval = MatrixNestedCrossValidation(
    method=NMF,
    X=R,
    M=M,
    K=no_folds,
    P=no_threads,
    parameter_search=parameter_search,
    train_config=train_config,
    file_performance=output_file,
    files_nested_performances=files_nested_performances)
nested_crossval.run()