BaşlayınÜcretsiz başlayın

PCA in a model pipeline

We just saw that legendary Pokemon tend to have higher stats overall. Let's see if we can add a classifier to our pipeline that detects legendary versus non-legendary Pokemon based on the principal components.

The data has been pre-loaded for you and split into training and tests datasets: X_train, X_test, y_train, y_test.

Same goes for all relevant packages and classes(Pipeline(), StandardScaler(), PCA(), RandomForestClassifier()).

Bu egzersiz, kursun bir parçasıdır

Dimensionality Reduction in Python

Kursa Göz Atın

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Build the pipeline
pipe = Pipeline([
        ('scaler', ____),
        ('reducer', ____),
        ('classifier', ____)])
Kodu Düzenle ve Çalıştır