Exemplo n.º 1
0
iterations = 2000
init_FG = 'kmeans'
init_S = 'random'
I, J, K, L = 622,138,5,5

minimum_TN = 0.01

alpha, beta = 1., 1.
lambdaF = numpy.ones((I,K))/10.
lambdaS = numpy.ones((K,L))/10.
lambdaG = numpy.ones((J,L))/10.
priors = { 'alpha':alpha, 'beta':beta, 'lambdaF':lambdaF, 'lambdaS':lambdaS, 'lambdaG':lambdaG }


# Load in data
(_,R,M,_,_,_,_) = load_gdsc(standardised=standardised)


# Run the VB algorithm, <repeats> times
times_repeats = []
performances_repeats = []
for i in range(0,repeats):
    # Set all the seeds
    numpy.random.seed(3)
    
    # Run the classifier
    NMTF = nmtf_icm(R,M,K,L,priors)
    NMTF.initialise(init_S=init_S,init_FG=init_FG)
    NMTF.run(iterations,minimum_TN=minimum_TN)

    # Extract the performances and timestamps across all iterations
Exemplo n.º 2
0
    'init_FG': 'kmeans',
    'init_S': 'exponential',
    'expo_prior': 0.1
}
P = 5
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, 'L': L} for (K, L) in [(6, 6), (8, 8), (10, 10)]]

# Load in the Sanger dataset
(_, X_min, M, _, _, _, _) = load_gdsc(standardised=standardised)

# Run the cross-validation framework
#random.seed(42)
#numpy.random.seed(9000)
nested_crossval = MatrixNestedCrossValidation(
    method=NMTF,
    X=X_min,
    M=M,
    K=no_folds,
    P=5,
    parameter_search=parameter_search,
    train_config=train_config,
    file_performance=output_file,
    files_nested_performances=files_nested_performances)
nested_crossval.run()
Exemplo n.º 3
0
    'iterations': 2000,
    'init_UV': 'exponential',
    'expo_prior': 0.1
}
K_range = [6, 8, 10, 12, 14]
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 Sanger dataset
(_, X_min, M, _, _, _, _) = load_gdsc(standardised=standardised, sep=',')

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