forked from Magic-Bubble/Mobike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
42 lines (33 loc) · 1.22 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class DefaultConfig(dict):
def __init__(self):
# ------------ 数据路径 ------------
self['data_dir'] = '../../MOBIKE_CUP_2017'
self['train_csv'] = self['data_dir'] + '/train.csv'
self['test_csv'] = self['data_dir'] + '/test.csv'
self['cache_dir'] = '../cache'
self['model_dir'] = '../snapshot'
self['result_dir'] = '../result'
# ------------ 训练参数 --------
self['startday'] = 23
self['endday'] = 25
self['lgb_leaves'] = 96
self['lgb_lr'] = 0.05
# ------------ 测试参数 --------
self['test_startday'] = 25
self['test_endday'] = 26
self['model_name'] = None
# -------- 是否有用户 --------
self['user'] = True
def update(self, **kwargs):
for key in kwargs:
self[key] = kwargs[key]
self['time_prefix'] = '2017-05-'
self['time_suffix'] = ' 00:00:00'
self['starttime'] = '2017-05-' + str(self['startday']) + ' 00:00:00'
self['endtime'] = '2017-05-' + str(self['endday']) + ' 00:00:00'
self['test_starttime'] = '2017-05-' + str(self['test_startday']) + ' 00:00:00'
self['test_endtime'] = '2017-05-' + str(self['test_endday']) + ' 00:00:00'
def printf(self):
print('Current Config:')
for key in self:
print('{}: {}'.format(key, self[key]))