Example #1
0
def get_model_id(model_name=None):

    df = db.get_data(table_name='models')
    df = df[df['model_name'] == model_name]
    if len(df) == 0:
        raise ValueError('model name not found!')
    else:
        return int(df['id'].values[0])
Example #2
0
def get_model_output_fields(model_name=None):
    model_id = get_model_id(model_name)
    df = db.get_data(table_name='model_output_config',
                     where_str='model_id = {0}'.format(model_id))
    return df
Example #3
0
def get_model_param_configs(model_name=None):
    model_id = get_model_id(model_name)
    df = db.get_data(table_name='model_param_config',
                     where_str='model_id ={0}'.format(model_id))
    df['model_params'] = df['model_params'].astype(str)
    return df
Example #4
0
def get_strategy_signals(model_name=None):

    model_id = get_model_id(model_name)
    s = db.get_data(table_name='model_signals',
                    where_str='model_id = {0}'.format(model_id))
    return s