コード例 #1
0
def _enter_data(args):
    atm = _get_atm(args)
    run_conf = RunConfig(args)
    dataset_conf = DatasetConfig(args)

    if run_conf.dataset_id is None:
        dataset = atm.add_dataset(**dataset_conf.to_dict())
        run_conf.dataset_id = dataset.id

    return atm.add_datarun(**run_conf.to_dict())
コード例 #2
0
def get_new_worker(**kwargs):
    kwargs['dataset_id'] = kwargs.get('dataset_id', None)
    kwargs['methods'] = kwargs.get('methods', ['logreg', 'dt'])
    run_conf = RunConfig(kwargs)

    kwargs['train_path'] = POLLUTION_PATH
    dataset_conf = DatasetConfig(kwargs)

    db = Database(dialect='sqlite', database=DB_PATH)
    atm = ATM(dialect='sqlite', database=DB_PATH)

    dataset = atm.add_dataset(**dataset_conf.to_dict())
    run_conf.dataset_id = dataset.id
    datarun = atm.add_datarun(**run_conf.to_dict())

    return Worker(db, datarun)