Training a model with PCA
Now that you have run PCA on the wine dataset, you'll finally train a KNN model using the transformed data.
Bu egzersiz
Preprocessing for Machine Learning in Python
kursunun bir parçasıdırEgzersiz talimatları
- Fit the
knnmodel to the PCA-transformed features,pca_X_train, and training labels,y_train. - Print the test set accuracy of the
knnmodel usingpca_X_testandy_test.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Fit knn to the training data
____
# Score knn on the test data and print it out
____