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

PCA on a larger dataset

You'll now apply PCA on a somewhat larger ANSUR datasample with 13 dimensions, once again pre-loaded as ansur_df. The fitted model will be used in the next exercise. Since we are not using the principal components themselves there is no need to transform the data, instead, it is sufficient to fit pca to the data.

Bu egzersiz

Dimensionality Reduction in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create the scaler.
  • Standardize the data.
  • Create the PCA() instance.
  • Fit it to the standardized data.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA

# Scale the data
scaler = ____
ansur_std = ____

# Apply PCA
pca = ____
pca.____
Kodu Düzenle ve Çalıştır