def train_model(name):
    try:
        model = utils.load_from_cache(name)
        logger.info('Loading model %s from cache' % name)
    except __HOLE__:
        cfgs = config.model_configs(name)
        model = make_model(name)
        data = get_model_data(name)
        logger.info('Training model %s' % name)
        if "target" in cfgs:
            (train_data, target), test_data = data
            model.fit(train_data, target)
        else:
            model.fit(data)
        utils.save_to_cache(model, name)
    return model
dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/models.py/train_model