This time I will use the scikit-learn module to bulid the classifiers,and I will use the randomforest’s importance to choose the explanatory variables.
Part1. Import the data and R’S randomforest importance
import pandas as pd
import numpy as np
df = pd.read_csv('C:/Users/User/OneDrive - student.nsysu.edu.tw/Educations/NSYSU/fu_chung/bacterial/123.csv')
impor = pd.read_csv('C:/Users/User/OneDrive - student.nsysu.edu.tw/Educations/NSYSU/fu_chung/bacterial - PCA/A.csv')
impo = np.array(impor['names'])
impo
array(['V994', 'V1428', 'V1426', ..., 'V1469', 'V1470', 'V1471'],
dtype=object)
Part2. Classifiers Building
Contain methods:
svm,randomforest,navie bayes,knn,lda,qda,adaboost,logistic regression.
Those function will return the:
“Methods Name”,
“All True amount”,
“Whole Accuracy”,
“True CRE amount”,
“True non-CRE amount”,
“CRE Accuracy”,
“non-CRE Accuracy”.
from sklearn import ensemble
from sklearn import metrics
from sklearn import svm
#SVM
def svmloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
clf = svm.SVC(kernel = 'linear') #SVM模組,svc,線性核函式
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "SupportVectorMachine",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
#RF
def rfloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
clf = ensemble.RandomForestClassifier(n_estimators = 10)
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "RandomForest",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
#NB
def nbloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
from sklearn.naive_bayes import GaussianNB
clf = GaussianNB()
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "NaiveBayes",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
#KNN
def knnloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
from sklearn.neighbors import KNeighborsClassifier
clf = KNeighborsClassifier(n_neighbors=3)
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "KNN",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
#LDA
def ldaloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
clf = LinearDiscriminantAnalysis(solver='lsqr', shrinkage=None, priors=None)
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "LDA",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
#QDA
def qdaloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
clf = QuadraticDiscriminantAnalysis()
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "QDA",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
#ADABOOST
def adaloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
from sklearn.ensemble import AdaBoostClassifier
clf = AdaBoostClassifier(n_estimators=100)
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "adaboost",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
#logistic
def glmloocv(ldf):
ldf = ldf.reset_index(drop=True)
cv = []
for i in range(len(ldf)):
dtrain = ldf.drop([i])
dtest = ldf.iloc[i:i+1,:]
train_X = dtrain.iloc[:,0:ldf.shape[1]-1]
test_X = dtest.iloc[:,0:ldf.shape[1]-1]
train_y = dtrain["CRE"]
test_y = dtest["CRE"]
from sklearn.linear_model import LogisticRegression
clf = LogisticRegression(C=1000, random_state=0)
clf_fit = clf.fit(train_X, train_y)
test_y_predicted = clf.predict(test_X)
accuracy_rf = metrics.accuracy_score(test_y, test_y_predicted)
cv += [accuracy_rf]
loocv = np.mean(cv)
return "LogisticRegression",sum(cv),loocv,sum(cv[0:46]),sum(cv[46:95]),sum(cv[0:46])/46,sum(cv[46:95])/49
Function Testing
ldf = df.loc[:,impo[0:3]]
ldf['CRE'] = df['CRE']
knnloocv(ldf)
('KNN',
50.0,
0.5263157894736842,
45.0,
5.0,
0.9782608695652174,
0.10204081632653061)
Part 3. Processing
import time
import sys
lsvm = []
for i in range (20):
ldf = df.loc[:,impo[0:30+i]]
ldf['CRE'] = df['CRE']
lsvm += [svmloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(20-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
lada = []
for i in range (50):
ldf = df.loc[:,impo[0:1+i]]
ldf['CRE'] = df['CRE']
lada += [adaloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(50-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
llda = []
for i in range (50):
ldf = df.loc[:,impo[0:1+i]]
ldf['CRE'] = df['CRE']
llda += [ldaloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(50-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
lqda = []
for i in range (50):
ldf = df.loc[:,impo[0:1+i]]
ldf['CRE'] = df['CRE']
lqda += [qdaloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(50-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
lrf = []
for i in range (50):
ldf = df.loc[:,impo[0:1+i]]
ldf['CRE'] = df['CRE']
lrf += [rfloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(50-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
lnb = []
for i in range (50):
ldf = df.loc[:,impo[0:1+i]]
ldf['CRE'] = df['CRE']
lnb += [nbloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(50-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
lglm = []
for i in range (50):
ldf = df.loc[:,impo[0:1+i]]
ldf['CRE'] = df['CRE']
lglm += [glmloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(50-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
lknn = []
for i in range (50):
ldf = df.loc[:,impo[0:1+i]]
ldf['CRE'] = df['CRE']
lknn += [knnloocv(ldf)]
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %d%%" % ('='*i, (100/(50-1))*i))
sys.stdout.flush()
time.sleep(0.00000000000001)
[================================================= ] 100%
[================================================= ] 100%
[================================================= ] 100%
[================================================= ] 100%
[================================================= ] 100%
[================================================= ] 100%
[================================================= ] 100%
[================================================= ] 100%
data = pd.concat([pd.DataFrame(lsvm),pd.DataFrame(lada),pd.DataFrame(lrf),pd.DataFrame(lnb),pd.DataFrame(llda),pd.DataFrame(lqda),pd.DataFrame(lknn),pd.DataFrame(lglm)], axis=1)
#Write the csv
data.to_csv("locv.csv",index=False,sep=',')
pd.read_csv('C:/Users/User/OneDrive - student.nsysu.edu.tw/Educations/NSYSU/fu_chung/CRE features selection/locv1.csv')
| num_cre | num_non | num_rf_impo | method | right_pred_num | acc | right_pred_cre_num | right_pred_ncre_num | right_pred_cre_acc | right_pred_ncre_acc | ... | right_pred_ncre_num.6 | right_pred_cre_acc.6 | right_pred_ncre_acc.6 | method.7 | right_pred_num.7 | acc.7 | right_pred_cre_num.7 | right_pred_ncre_num.7 | right_pred_cre_acc.7 | right_pred_ncre_acc.7 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 46 | 49 | 1 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 5 | 0.978261 | 0.102041 | LogisticRegression | 48 | 0.505263 | 43 | 5 | 0.934783 | 0.102041 |
| 1 | 46 | 49 | 2 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 5 | 0.978261 | 0.102041 | LogisticRegression | 48 | 0.505263 | 43 | 5 | 0.934783 | 0.102041 |
| 2 | 46 | 49 | 3 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 5 | 0.978261 | 0.102041 | LogisticRegression | 48 | 0.505263 | 43 | 5 | 0.934783 | 0.102041 |
| 3 | 46 | 49 | 4 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 10 | 0.978261 | 0.204082 | LogisticRegression | 52 | 0.547368 | 42 | 10 | 0.913043 | 0.204082 |
| 4 | 46 | 49 | 5 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 32 | 0.804348 | 0.653061 | LogisticRegression | 52 | 0.547368 | 34 | 18 | 0.739130 | 0.367347 |
| 5 | 46 | 49 | 6 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 32 | 0.804348 | 0.653061 | LogisticRegression | 52 | 0.547368 | 34 | 18 | 0.739130 | 0.367347 |
| 6 | 46 | 49 | 7 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 34 | 0.804348 | 0.693878 | LogisticRegression | 54 | 0.568421 | 33 | 21 | 0.717391 | 0.428571 |
| 7 | 46 | 49 | 8 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 38 | 0.891304 | 0.775510 | LogisticRegression | 56 | 0.589474 | 39 | 17 | 0.847826 | 0.346939 |
| 8 | 46 | 49 | 9 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 37 | 0.891304 | 0.755102 | LogisticRegression | 56 | 0.589474 | 39 | 17 | 0.847826 | 0.346939 |
| 9 | 46 | 49 | 10 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 37 | 0.891304 | 0.755102 | LogisticRegression | 56 | 0.589474 | 39 | 17 | 0.847826 | 0.346939 |
| 10 | 46 | 49 | 11 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 37 | 0.891304 | 0.755102 | LogisticRegression | 59 | 0.621053 | 39 | 20 | 0.847826 | 0.408163 |
| 11 | 46 | 49 | 12 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 41 | 0.760870 | 0.836735 | LogisticRegression | 60 | 0.631579 | 44 | 16 | 0.956522 | 0.326531 |
| 12 | 46 | 49 | 13 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.847826 | 0.897959 | LogisticRegression | 60 | 0.631579 | 45 | 15 | 0.978261 | 0.306122 |
| 13 | 46 | 49 | 14 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.847826 | 0.897959 | LogisticRegression | 60 | 0.631579 | 45 | 15 | 0.978261 | 0.306122 |
| 14 | 46 | 49 | 15 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.826087 | 0.897959 | LogisticRegression | 61 | 0.642105 | 45 | 16 | 0.978261 | 0.326531 |
| 15 | 46 | 49 | 16 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.826087 | 0.897959 | LogisticRegression | 59 | 0.621053 | 44 | 15 | 0.956522 | 0.306122 |
| 16 | 46 | 49 | 17 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.826087 | 0.897959 | LogisticRegression | 65 | 0.684211 | 46 | 19 | 1.000000 | 0.387755 |
| 17 | 46 | 49 | 18 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 45 | 0.826087 | 0.918367 | LogisticRegression | 61 | 0.642105 | 46 | 15 | 1.000000 | 0.306122 |
| 18 | 46 | 49 | 19 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 45 | 0.826087 | 0.918367 | LogisticRegression | 60 | 0.631579 | 45 | 15 | 0.978261 | 0.306122 |
| 19 | 46 | 49 | 20 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 46 | 0.826087 | 0.938776 | LogisticRegression | 61 | 0.642105 | 44 | 17 | 0.956522 | 0.346939 |
| 20 | 46 | 49 | 21 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 45 | 0.804348 | 0.918367 | LogisticRegression | 61 | 0.642105 | 44 | 17 | 0.956522 | 0.346939 |
| 21 | 46 | 49 | 22 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 45 | 0.804348 | 0.918367 | LogisticRegression | 65 | 0.684211 | 42 | 23 | 0.913043 | 0.469388 |
| 22 | 46 | 49 | 23 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.804348 | 0.897959 | LogisticRegression | 67 | 0.705263 | 41 | 26 | 0.891304 | 0.530612 |
| 23 | 46 | 49 | 24 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.804348 | 0.897959 | LogisticRegression | 67 | 0.705263 | 42 | 25 | 0.913043 | 0.510204 |
| 24 | 46 | 49 | 25 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.804348 | 0.897959 | LogisticRegression | 64 | 0.673684 | 40 | 24 | 0.869565 | 0.489796 |
| 25 | 46 | 49 | 26 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 44 | 0.804348 | 0.897959 | LogisticRegression | 66 | 0.694737 | 41 | 25 | 0.891304 | 0.510204 |
| 26 | 46 | 49 | 27 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 45 | 0.804348 | 0.918367 | LogisticRegression | 68 | 0.715789 | 40 | 28 | 0.869565 | 0.571429 |
| 27 | 46 | 49 | 28 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 45 | 0.804348 | 0.918367 | LogisticRegression | 66 | 0.694737 | 38 | 28 | 0.826087 | 0.571429 |
| 28 | 46 | 49 | 29 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | 45 | 0.804348 | 0.918367 | LogisticRegression | 68 | 0.715789 | 40 | 28 | 0.869565 | 0.571429 |
| 29 | 46 | 49 | 30 | SupportVectorMachine | 87.0 | 0.915789 | 42.0 | 45.0 | 0.913043 | 0.918367 | ... | 46 | 0.826087 | 0.938776 | LogisticRegression | 69 | 0.726316 | 40 | 29 | 0.869565 | 0.591837 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 219 | 46 | 49 | 220 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 220 | 46 | 49 | 221 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 221 | 46 | 49 | 222 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 222 | 46 | 49 | 223 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 88 | 0.926316 | 42 | 46 | 0.913043 | 0.938776 |
| 223 | 46 | 49 | 224 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 224 | 46 | 49 | 225 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 225 | 46 | 49 | 226 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 88 | 0.926316 | 42 | 46 | 0.913043 | 0.938776 |
| 226 | 46 | 49 | 227 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 227 | 46 | 49 | 228 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 228 | 46 | 49 | 229 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 89 | 0.936842 | 43 | 46 | 0.934783 | 0.938776 |
| 229 | 46 | 49 | 230 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 88 | 0.926316 | 42 | 46 | 0.913043 | 0.938776 |
| 230 | 46 | 49 | 231 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 87 | 0.915789 | 42 | 45 | 0.913043 | 0.918367 |
| 231 | 46 | 49 | 232 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 87 | 0.915789 | 42 | 45 | 0.913043 | 0.918367 |
| 232 | 46 | 49 | 233 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 87 | 0.915789 | 42 | 45 | 0.913043 | 0.918367 |
| 233 | 46 | 49 | 234 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 88 | 0.926316 | 42 | 46 | 0.913043 | 0.938776 |
| 234 | 46 | 49 | 235 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 88 | 0.926316 | 42 | 46 | 0.913043 | 0.938776 |
| 235 | 46 | 49 | 236 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.847826 | 0.979592 | LogisticRegression | 87 | 0.915789 | 42 | 45 | 0.913043 | 0.918367 |
| 236 | 46 | 49 | 237 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 237 | 46 | 49 | 238 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 238 | 46 | 49 | 239 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 239 | 46 | 49 | 240 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 240 | 46 | 49 | 241 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 241 | 46 | 49 | 242 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 242 | 46 | 49 | 243 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 243 | 46 | 49 | 244 | SupportVectorMachine | 90.0 | 0.947368 | 42.0 | 48.0 | 0.913043 | 0.979592 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 244 | 46 | 49 | 245 | SupportVectorMachine | 89.0 | 0.936842 | 42.0 | 47.0 | 0.913043 | 0.959184 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 245 | 46 | 49 | 246 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 246 | 46 | 49 | 247 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 247 | 46 | 49 | 248 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
| 248 | 46 | 49 | 249 | SupportVectorMachine | 88.0 | 0.926316 | 41.0 | 47.0 | 0.891304 | 0.959184 | ... | 48 | 0.869565 | 0.979592 | LogisticRegression | 90 | 0.947368 | 43 | 47 | 0.934783 | 0.959184 |
249 rows × 59 columns
All of the above results, the best accuracy is adaboost in the interval between 67~166. Its accuracy in 0.989473684. Only miss one prediction.