-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
67 lines (59 loc) · 2.29 KB
/
Copy pathmain.py
File metadata and controls
67 lines (59 loc) · 2.29 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
67
#main.py
from regularization_methods import regularized_rfr_CV_features_removed
from datetime import datetime
from ensemble_learning_techniques import residual_ensemble_rfr
from csv_loading import load_data, data_inspection
from visualization import visualization
from shapley import shapley
#entry point for program to run
def main():
#start time
start_time = datetime.now()
print("Program started at:", start_time)
filepath = "data\Data-Table_1.csv"
print("***** Welcome to the Urban Air Quality and Health Risk Prediction Program *****")
#popup()
print("###Loading Data###")
df = load_data(filepath)
#check out and fix data
print("###Data Inspection###")
dataframe = data_inspection(df)
print()
#print("***###*** Restarting program, using new datafame with less features ***###***")
print("### Removing Low Importance Features ###")
new_filepath, new_dataframe = regularized_rfr_CV_features_removed(dataframe)
# df = load_data(new_filepath)
# new_dataframe = data_inspection(df)
print("***** Starting ensemble methods *****")
print("###Residual Ensemble Random Forest###")
residual_ensemble_rfr(new_dataframe)
#print("***###*** Running RFR models again after removing lower importance features ***###***")
print("")
print("Starting visualization attempts")
visualization(new_dataframe)
#print("***** Welcome to the Urban Air Quality and Health Risk Prediction Program *****")
#new_dataframe = whole_main(new_filepath, stuff)
print()
print("Mahalo Nui Loa for using the Urban Air Quality and Health Risk Prediction Program")
print()
print("Program Pau :)")
#combining csv data so it’s easier to compare R2 and MAE
#folder_path = "data"
#combined_df = combine_csvs_to_dataframe(folder_path)
#print(combined_df.head())
#print(combined_df.tail())
#combined_df.to_csv(f"_ALL_csv_data_combined.csv", index=False)
best_model = residual_ensemble_rfr(new_dataframe)
shapley(best_model, new_dataframe)
print("Done with shapley")
print()
#end time
end_time = datetime.now()
print()
print()
print("Program finished at:", end_time)
#print elapsed time
elapsed = end_time - start_time
print("Elapsed time:", elapsed)
if __name__ == "__main__":
main()