-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute_everything.py
More file actions
66 lines (59 loc) · 2.07 KB
/
Copy pathexecute_everything.py
File metadata and controls
66 lines (59 loc) · 2.07 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# AUTHOR : Arpit Mathur
# Script Creation date: 22-06-2019 1:35AM
# execute everything
import os
import warnings
# matplotlib warnings on my system
# ## UserWarning: Matplotlib is currently using agg, which is a non-GUI
# ## backend, so cannot show the figure.
warnings.filterwarnings("ignore")
# get file paths, so that we can create the folders necessary
filePath = os.path.realpath(__file__)
filePath = filePath[:filePath.rfind('\\')]
# relative paths to be created
filePathsToCreate = [
'\\data_clean',
'\\final_data',
'\\model_history',
'\\models',
'\\visualizations',
'\\models\\linear',
'\\models\\RFR',
'\\models\\SVR',
'\\visualizations\\linear',
'\\visualizations\\RFR',
'\\visualizations\\SVR'
]
print("creating folders")
# creating folders
for relFilePath in filePathsToCreate:
try:
print("creating> {0}".format(filePath + relFilePath))
os.mkdir(filePath + relFilePath)
except FileExistsError:
print("folder already exists: {0}".format(filePath + relFilePath))
print("folders created")
print("data cleaning shall start")
try:
# this shall execute the entirity of the cleaning data script
# since it doesn't contain any class / methods
import resources.clean_data
except Exception as ex:
print(ex)
print("data cleaning completed")
print("model creation starts")
print("""\twe shall be using Linear Models, Random Forest Regressor Models,
Support Vector Machine Models""")
try:
# this shall execute the entirity of the creation of the model script
import resources.create_final_prediction_model
except Exception as ex:
print(ex)
print("model creation has ended")
print("===>")
print("please go to the following directories for additional information")
print(""" - visualization files per item per model /visualizations
- visualization files per item after cleaning /visualizations
- historic model files per item (CSV data) /model_history
- historic model files per item /models
- all predictions based on optimized models /final_data""")