text_plain_output_2.png application_vnd.jupyter.stderr_output_1.png
from sklearn.ensemble import BaggingClassifier

from sklearn.feature_selection import RFE

from sklearn.feature_selection import RFECV

from sklearn.linear_model import LogisticRegression

from sklearn.multiclass import OneVsRestClassifier

from sklearn.svm import SVC

from sklearn.linear_model import LogisticRegression
logreg = LogisticRegression(C=10)
logreg.fit(X_train, Y_train)
Y_predict1 = logreg.predict(X_test)

score_logreg = logreg.score(X_test, Y_test)

from sklearn.feature_selection import RFE
logreg_2 = LogisticRegression()
rfe = RFE(estimator=logreg_2, n_features_to_select=5, step=1)
rfe = rfe.fit(X_train, Y_train)
X_train_3 = rfe.transform(X_train)
X_test_3 = rfe.transform(X_test)
logreg_2 = LogisticRegression()
logreg_2 = logreg_2.fit(X_train_3, Y_train)
Y_predict2 = logreg.predict(X_test_3)
score_logreg = logreg_2.score(X_test_3, Y_test)

from sklearn.feature_selection import RFECV
logreg_3 = LogisticRegression()
rfecv = RFECV(estimator=logreg_3, step=1, cv=5, scoring='accuracy')
rfecv = rfecv.fit(X_train, Y_train)

from sklearn.ensemble import BaggingClassifier
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import SVC
svmcla = OneVsRestClassifier(BaggingClassifier(SVC(C=10, kernel='rbf', random_state=9, probability=True), n_jobs=-1))
svmcla.fit(X_train, Y_train)
Y_predict2 = svmcla.predict(X_test)

score_svmcla = svmcla.score(X_test, Y_test)
print(score_svmcla)