Example #1
0
    def setUpClass(cls):
        if MPControl.is_initialized:
            MPControl.shutdown()

        MPControl.set_multiprocess_engine("dask-local")
        MPControl.set_processes(1)
        MPControl.connect()
BSUBTILIS_1_METADATA = 'GSE67023_meta_data.tsv'

BSUBTILIS_2_EXPRESSION = 'expression.tsv.gz'
BSUBTILIS_2_METADATA = 'meta_data.tsv'

CV_SEEDS = list(range(42, 52))

# Multiprocessing uses the pathos implementation of multiprocessing (with dill instead of cPickle)
# This is suited for a single computer but will not work on a distributed cluster

n_cores_local = 10
local_engine = True

# Multiprocessing needs to be protected with the if __name__ == 'main' pragma
if __name__ == '__main__' and local_engine:
    MPControl.set_multiprocess_engine("multiprocessing")
    MPControl.client.processes = n_cores_local
    MPControl.connect()

# Inference on B. subtilis data set 1 (GSE67023) with BBSR
# Using the crossvalidation wrapper
# Run the regression 10 times and hold 20% of the gold standard out of the priors for testing each time
# Each run is seeded differently (and therefore has different holdouts)

# Create a crossvalidation wrapper
cv_wrap = CrossValidationManager()

# Assign variables for grid search
cv_wrap.add_gridsearch_parameter('random_seed', CV_SEEDS)

# Create a worker
Example #3
0
    def tearDownClass(cls):
        if MPControl.is_initialized:
            MPControl.shutdown()

        MPControl.set_multiprocess_engine("local")
        MPControl.connect()