def load_table(self, train_or_test, feature_timestamp):
# get feature table name
if feature_timestamp == '%':
feature_timestamp = pd.read_sql('''
SELECT
split_part(table_name, '_at_', 2)
FROM
information_schema.tables
WHERE
table_schema = 'feature_tables'
ORDER BY
1 desc
LIMIT
1;
''', con).iat[0,0]
feature_table_name = ('{}."features_{}_{}_{}_at_{}"').format(config_db['feature_schema'],
train_or_test, self.fake_today, self.prediction_window,
feature_timestamp)
# load table
print 'loading {}'.format(feature_table_name)
query = ('SELECT * FROM {}').format(feature_table_name)
full_feature_table = pd.read_sql(query, con = con)
return full_feature_table, feature_table_name
feature_model_grabber.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录