Beispiel #1
0
def DoEXP01inner():
    """
    Executes the inner CV loop for all methods, networks and parameters and the two datasets.
    """
    
    #We need to know how the outer loop looks like
    nr_crossvals = 1
    nr_folds = 5
    #Parameters for the inner loop
    nr_crossvals_inner = 1
    nr_folds_inner = 5

    #Combine data, networks methods and other parameters
    DataAndFeatureExtractors = CombineDataExperiment01()
    #Create tokens.
    #For each possible combination of outer and inner crossval, outer and inner fold and parameters in DataAndFeatureExtractors
    #we receive one token. They all carry the Prefix EXP01.
    #If you work with a HPC you can store them as tokens in a database or other tool.
    tokens = generate_tokens_innerloop(DataAndFeatureExtractors, nr_crossvals, nr_folds, nr_crossvals_inner, nr_folds_inner, 'EXP01InnerLoop')
    
    #Execute calculations and store results
    #1) Locally process tokens
    doneTokens = []
    for token in tokens:
        #db may be a couchDB db
        doneTokens.append(localProcess(token, db = None))
    #2) For a couchDB use the pipeline script

    #Write results to an sql database
    sqlName = "_"+datetime.datetime.now().strftime('%b-%d-%G')
    sqlPath = "Results/"
    sqlFilename = sqlPath+"EXP01InnerLoop"+sqlName+".sqlite3"
    TokenToSqliteExperiment01InnerLoop(tokens, sqlFilename)
Beispiel #2
0
def DoEXP01outer():
    """
    Executes the outer CV loop for all methods, networks and parameters and the two datasets.
    """
    #Do not repeat the CV
    nr_crossvals = 1
    #Split data in five parts
    nr_folds = 5

    #Combine data, networks methods and other parameters
    DataAndFeatureExtractors = CombineDataExperiment01()
    #Create tokens that also contain the info about the splits and number CVs we want to execute
    #For each possible combination of crossval, fold and parameters in DataAndFeatureExtractors
    #we receive one token. They all carry the Prefix EXP01.
    #If you work with a HPC you can store them as tokens in a database or other tool.
    tokens = generate_tokens(DataAndFeatureExtractors, nr_crossvals, nr_folds, 'EXP01')

    #Execute calculations and store results
    #1) Locally process tokens
    doneTokens = []
    for token in tokens:
        #db may be a couchDB db
        doneTokens.append(localProcess(token, db = None))
    #2) For a couchDB use the pipeline script

    #Write results to an sql database
    sqlName = "_"+datetime.datetime.now().strftime('%b-%d-%G')
    sqlPath = "Results/"
    sqlFilename = sqlPath+"EXP01"+sqlName+".sqlite3"
    TokenToSqliteExperiment01(tokens, sqlFilename)
Beispiel #3
0
def DoEXP04outer():
    """
    Executes the outer CV loop for all methods, networks and parameters and the two datasets with the ER positive patients only.
    """
    #Comments as in DoEXP01outer
    nr_crossvals = 1
    nr_folds = 5

    DataAndFeatureExtractors = CombineDataExperiment01()
    tokens = generate_tokens(DataAndFeatureExtractors, nr_crossvals, nr_folds, 'EXP04')

    doneTokens = []
    for token in tokens:
        doneTokens.append(localProcess(token, db = None))
    
    sqlName = "_"+datetime.datetime.now().strftime('%b-%d-%G')
    sqlPath = "Results/"
    sqlFilename = sqlPath+"EXP04"+sqlName+".sqlite3"
    TokenToSqliteExperiment01(tokens, sqlFilename)
Beispiel #4
0
def DoEXP05outer():
    """
    As DoEXP01outer but also shuffling the network and pathway data.
    """
    #Comments as in DoEXP01outer
    nr_crossvals = 1
    nr_folds = 5

    #Shuffle networks and pathways 25 times
    num_shuffles = 25

    DataAndFeatureExtractors = CombineDataExperiment05()
    tokens = generate_tokens(DataAndFeatureExtractors, nr_crossvals, nr_folds, 'EXP05')

    doneTokens = []
    for token in tokens:
        doneTokens.append(localProcess(token, db = None))

    sqlName = "_"+datetime.datetime.now().strftime('%b-%d-%G')
    sqlPath = "Results/"
    sqlFilename = sqlPath+"EXP05"+sqlName+".sqlite3"
    TokenToSqliteExperiment05(tokens, sqlFilename)