text_plain_output_1.png image_output_1.png
from sklearn.decomposition import PCA

from sklearn.linear_model import LogisticRegression

from sklearn.pipeline import Pipeline

from sklearn.preprocessing import StandardScaler

from sklearn.svm import SVC

pipeline_1 = Pipeline([('scl', StandardScaler()), ('pca', PCA(n_components=2)), ('clf', LogisticRegression(random_state=1))])
pipeline_1.fit(X_train, y_train)
print('Resultado: %.3f' % pipeline_1.score(X_test, y_test))
from sklearn.svm import SVC
pipeline_svm = Pipeline([('scl', StandardScaler()), ('clf', SVC(kernel='linear', C=0.05, random_state=1))])
pipeline_svm.fit(X_train, y_train)
print('Resultado: %.3f' % pipeline_svm.score(X_test, y_test))