Exemplo n.º 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(42)
#numpy.random.seed(9000)
nested_crossval = GreedySearchCrossValidation(
    classifier=bnmtf_vb_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,
    quality_metric=quality_metric,
    file_performance=output_file
)
nested_crossval.run()
output_file = "./results.txt"

alpha, beta = 1.0, 1.0
lambdaF = 1.0 / 10.0
lambdaS = 1.0 / 10.0
lambdaG = 1.0 / 10.0
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,
    quality_metric=quality_metric,
    file_performance=output_file,
)
nested_crossval.run(burn_in=burn_in, thinning=thinning)
Exemplo n.º 3
0
random.seed(42)
numpy.random.seed(9000)
nested_crossval = GreedySearchCrossValidation(classifier=bnmtf_vb_optimised,
                                              R=X_min,
                                              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,
                                              quality_metric=quality_metric,
                                              file_performance=output_file)
nested_crossval.run()
"""
All model fits for fold 1, metric AIC: [(5, 5, 267436.21583785285), (6, 5, 268266.96019512357), (5, 6, 257633.99837328543), (6, 6, 258811.15017865735), (5, 7, 267685.94226889982), (6, 7, 259475.47788105684)].
Best K,L for fold 1: (5, 6).
Performance: {'R^2': 0.8054505750429645, 'MSE': 2.260784680365453, 'Rp': 0.89749750215470236}.

All model fits for fold 2, metric AIC: [(5, 5, 257397.3462916202), (6, 5, 258208.83672100294), (5, 6, 258507.40258252042), (6, 6, 268899.95363038778)].
Best K,L for fold 2: (5, 5).
Performance: {'R^2': 0.7932515856937303, 'MSE': 2.4062208604789466, 'Rp': 0.89070894807048406}.

All model fits for fold 3, metric AIC: [(5, 5, 257474.56778980303), (6, 5, 263139.31012906466), (5, 6, 257897.25841092237), (6, 6, 258977.56348133401)].
Best K,L for fold 3: (5, 5).
Performance: {'R^2': 0.795777258139038, 'MSE': 2.432808555965515, 'Rp': 0.89214912313681782}.

All model fits for fold 4, metric AIC: [(5, 5, 257590.35016277712), (6, 5, 257910.38864371926), (5, 6, 262678.73114371556), (6, 6, 268566.63052480557)].
Best K,L for fold 4: (5, 5).
Exemplo n.º 4
0
# Load in the Sanger dataset
(_,X_min,M,_,_,_,_) = load_gdsc(standardised=standardised,sep=',')

# Run the cross-validation framework
#random.seed(1)
#numpy.random.seed(1)
nested_crossval = GreedySearchCrossValidation(
    classifier=nmtf_icm,
    R=X_min,
    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,
    quality_metric=quality_metric,
    file_performance=output_file
)
nested_crossval.run(minimum_TN=minimum_TN)

"""
all_MSE = [2.2020002331612534, 2.2364503149918011, 2.1611831576199534, 2.1569381861635395, 2.1530470452271864, 2.272519698528658, 2.1910498022580613, 2.2302383199950797, 2.1027416628364484, 2.283196008129782]
all_R2 = [0.8068027775294401, 0.8122652321538621, 0.8155286993833876, 0.8151068635575036, 0.8227521825461013, 0.8062086302462692, 0.8136429679161671, 0.8113058601446024, 0.8152542609952846, 0.8080593057170452]

Average MSE: 2.1989364428911764 +- 0.0029521290510586768
Average R^2: 0.81269267801896627 +- 2.2283761452627026e-05
"""
Exemplo n.º 5
0
nested_crossval = GreedySearchCrossValidation(
    classifier=nmtf_icm,
    R=X_min,
    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,
    quality_metric=quality_metric,
    file_performance=output_file
)
nested_crossval.run(minimum_TN=minimum_TN)

"""
All model fits for fold 1, metric AIC: [(4, 4, 259815.59627734334), (5, 4, 264878.72889689816), (4, 5, 259898.0246359052), (5, 5, 264190.02866958058)].
Best K,L for fold 1: (4, 4).
Performance: {'R^2': 0.7848296007416965, 'MSE': 2.500413159374383, 'Rp': 0.88598937222369789}.

All model fits for fold 2, metric AIC: [(4, 4, 260488.27142912982), (5, 4, 263264.96055363037), (4, 5, 260274.90755926829), (5, 5, 261622.0288602885), (4, 6, 260688.39772746345), (5, 6, 260912.61739148491)].
Best K,L for fold 2: (4, 5).
Performance: {'R^2': 0.7849633576236031, 'MSE': 2.5026825786772009, 'Rp': 0.88614872134170442}.

All model fits for fold 3, metric AIC: [(4, 4, 264054.08623711637), (5, 4, 262806.79434115923), (4, 5, 260829.63729924717), (5, 5, 260582.07428581853), (6, 5, 260368.48302208679), (5, 6, 261003.79373016706), (6, 6, 258770.32484170242), (7, 6, 256477.54559461726), (6, 7, 257521.93464259332), (7, 7, 255691.8631798806), (8, 7, 255839.06730957987), (7, 8, 254914.70496735093), (8, 8, 252414.47280171167)].
Best K,L for fold 3: (8, 8).
Performance: {'R^2': 0.799400251360757, 'MSE': 2.3896495579632071, 'Rp': 0.89434952909414756}.

All model fits for fold 4, metric AIC: [(4, 4, 259837.14859489043), (5, 4, 264873.83666251029), (4, 5, 260496.69826487306), (5, 5, 262240.62301195401)].
Exemplo n.º 6
0
random.seed(42)
numpy.random.seed(9000)
nested_crossval = GreedySearchCrossValidation(classifier=bnmtf_gibbs_optimised,
                                              R=X_min,
                                              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,
                                              quality_metric=quality_metric,
                                              file_performance=output_file)
nested_crossval.run(burn_in=burn_in, thinning=thinning)
"""
All model fits for fold 1, metric AIC: [(4, 4, 262436.98303210537), (5, 4, 273407.76496789115), (4, 5, 263360.9277280402), (5, 5, 263400.5606913346)].
Best K,L for fold 1: (4, 4).
Performance: {'R^2': 0.7800291750013955, 'MSE': 2.5561970763677193, 'Rp': 0.88322370788808247}.

All model fits for fold 2, metric AIC: [(4, 4, 264745.89944073628), (5, 4, 267367.49610899633), (4, 5, 263978.79956275201), (5, 5, 265730.82631668856), (4, 6, 264306.77140626271), (5, 6, 266071.64877511811)].
Best K,L for fold 2: (4, 5).
Performance: {'R^2': 0.7793797705537095, 'MSE': 2.5676666015484755, 'Rp': 0.88294516494592834}.

All model fits for fold 3, metric AIC: [(4, 4, 269196.33589161438), (5, 4, 264955.89814824361), (4, 5, 266505.80081558786), (5, 5, 265883.96613683912), (6, 4, 270369.78494787007), (6, 5, 262221.11539569066), (7, 5, 268584.82367791957), (6, 6, 261034.21177468935), (7, 6, 265304.18808236072), (6, 7, 261208.71399229951), (7, 7, 262222.32652767492)].
Best K,L for fold 3: (6, 6).
Performance: {'R^2': 0.7852422451314671, 'MSE': 2.5583071637526698, 'Rp': 0.88627262096199066}.

All model fits for fold 4, metric AIC: [(4, 4, 264227.12581318244), (5, 4, 269245.63521912333), (4, 5, 267216.17738850694), (5, 5, 264999.82046250795)].
Best K,L for fold 4: (4, 4).