-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_all.py
More file actions
27 lines (24 loc) · 1.33 KB
/
Copy pathtest_all.py
File metadata and controls
27 lines (24 loc) · 1.33 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
import mgr.data.readrawdata as rd
import mgr.calc.signal as sig
from sklearn.ensemble import RandomForestClassifier
from sklearn.dummy import DummyClassifier
from sklearn.neural_network import MLPClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.naive_bayes import GaussianNB
import numpy as np
import csv
features_all = np.loadtxt('mgr/data/resources/all/Features_all.csv', delimiter=",")
dummy_cls_all = DummyClassifier()
k_neighbors_cls_all = KNeighborsClassifier()
decision_tree_cls_all = DecisionTreeClassifier()
random_forest_cls_all = RandomForestClassifier()
mlp_cls_all = MLPClassifier()
gaussian_nb_cls_all = GaussianNB()
print('Test Classifiers on ALL learned with data collected by ALL')
print('Dummy Classifier ', sig.test_and_learn_classifier(dummy_cls_all, features_all))
print('K-Neighbors Classifier ', sig.test_and_learn_classifier(k_neighbors_cls_all, features_all))
print('Decision Tree Classifier', sig.test_and_learn_classifier(decision_tree_cls_all, features_all))
print('Random Forest Classifier', sig.test_and_learn_classifier(random_forest_cls_all, features_all))
print('MLP Classifier ', sig.test_and_learn_classifier(mlp_cls_all, features_all))
print('GaussianNB ', sig.test_and_learn_classifier(gaussian_nb_cls_all, features_all))