forked from A7mad7sn/Loan-Prediction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
107 lines (96 loc) · 7.42 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# importing Modules
import Preprocessing
import Feature_Selection_Splitting
import Logistic_Regression
import Decision_Tree
import SVM
import Getter
#Data Cleaning & Preprocessing & Data Scaling :-
loan_Df = Preprocessing.Preprocessing()
#Feature Selection & Data Splitting :-
ReadyData = Feature_Selection_Splitting.feature_selection_and_data_Splitting(loan_Df)
print ('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n')
print(' -* Welcome to our Loan Predictor *-\n')
while(True):
print('Press :')
print('-------')
print(' 1 --> To Show Models and accuracy.')
print(' 2 --> To Predict Loan Status.\n')
Option = input (' Option ==> ')
if(Option != '1' and Option != '2'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
print(' Invalid !')
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
continue
else:
break
#when user choose to view Models :-
if (Option == '1'):
while(True):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
print('Please Select The algorithm you want : ')
print('---------------------------------------')
print(' 1 --> for Logistic Regression.')
print(' 2 --> for Support Vector Machine.')
print(' 3 --> for Decision Tree.')
print(' 4 --> for All Algorithms.\n')
fOption = input(' Option ==> ')
if(fOption != '1' and fOption != '2' and fOption != '3' and fOption != '4'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
print(' Invalid !')
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
continue
else:
break
if (fOption == '1'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Logistic_Regression.Logistic_algorirthm(ReadyData)
elif (fOption == '2'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
SVM.SVM_Algorithm(ReadyData)
elif (fOption == '3'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Decision_Tree.Decision_Tree_Algoithm(ReadyData)
elif (fOption == '4'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Logistic_Regression.Logistic_algorirthm(ReadyData)
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
SVM.SVM_Algorithm(ReadyData)
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Decision_Tree.Decision_Tree_Algoithm(ReadyData)
#When User choose to predict !
elif (Option == '2'):
features = Getter.FeaturesGetter()
while(True):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
print('Please Select The algorithm you want : ')
print('---------------------------------------')
print(' 1 --> for Logistic Regression.')
print(' 2 --> for Support Vector Machine.')
print(' 3 --> for Decision Tree.')
print(' 4 --> for All Algorithms.\n')
sOption = input(' Option ==> ')
if(sOption != '1' and sOption != '2' and sOption != '3' and sOption != '4'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
print(' Invalid !')
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
continue
else:
break
if (sOption == '1'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Logistic_Regression.Logistic_Predictor(ReadyData, features)
elif (sOption == '2'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
SVM.SVM_Predictor(ReadyData, features)
elif (sOption == '3'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Decision_Tree.ID3_Predictor(ReadyData, features)
elif (sOption == '4'):
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Logistic_Regression.Logistic_Predictor(ReadyData, features)
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
SVM.SVM_Predictor(ReadyData, features)
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')
Decision_Tree.ID3_Predictor(ReadyData, features)
print('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------')