-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_ml_algorithms.py
58 lines (47 loc) · 1.58 KB
/
test_ml_algorithms.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
#!/usr/bin/env
# -*- coding: utf-8 -*-
"""
Copyright 2017-2018 Jagoba Pérez-Gómez
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from ml_algorithms.models import ModelTest
def select_option():
print('1. Linear')
print('2. Gaussian NB')
print('3. SVR')
print('4. Logistic Regression')
print('5. K Neighbours Classifier')
print('6. Decision Tree Classifier')
print('7. SVC')
print('8. Exit')
return int(input('Your selection [1-8]:'))
def load_script(model_test, option):
if option == 1:
model_test.test_linear()
elif option == 2:
model_test.test_gaussian_nb()
elif option == 3:
model_test.test_svr()
elif option == 4:
model_test.test_logistic_regression()
elif option == 5:
model_test.test_knn_classifier()
elif option == 6:
model_test.test_decision_tree_classifier()
elif option == 7:
model_test.test_svc()
if __name__ == '__main__':
option = 0
model_test = ModelTest()
model_test.prepare_data_set()
while option != 8:
option = select_option()
load_script(model_test, option)