-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
45 lines (30 loc) · 1.26 KB
/
main.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
43
44
45
from utils import return_logs, prepare_data
import os
import pandas as pd
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
import config
pdata_func = prepare_data()
def main():
os.makedirs(os.path.join(os.getcwd(),'logs'),exist_ok=True)
os.makedirs(os.path.join(os.getcwd(),'logs_images'),exist_ok=True)
os.makedirs(os.path.join(os.getcwd(),'saved_model'),exist_ok=True)
logging = return_logs(os.path.join(os.getcwd(),'logs','process.log'))
# pull data
if os.path.isfile(os.path.join(os.getcwd(),'data','dataset.parquet')):
data = pd.read_parquet(os.path.join(os.getcwd(),'data','dataset.parquet'))
else:
# data = pdata_func.download_data(config.TICKET_LIST)
data = pdata_func.collect_data(True,True)
data.to_parquet("data/original_dataset.parquet")
# handle data
data = pdata_func.filling_missing_value(data, "default_value")
print(data.head())
# train reinforcement learning
# logging.info("train reinforcement leaning")
# data = pd.read_csv(os.path.join(os.getcwd(),'dataset','train_test.csv'),index_col=0)
# model_rl = train_rl(dataset=data)
# model_rl.start()
#
if __name__ == "__main__":
main()