НачатьНачать бесплатно

Scaling parts of a dataset

In previous videos, you've used the QuantileTransformer on the full dataset. In this exercise, you will practice scaling only parts of a dataset. The reason for doing this is that the stocks datasets have numerically-encoded categorical features (day_of_week, day, month) that would have been incorrectly scaled if you used QuantileTransformer on the full dataset.

The transformer has been imported from sklearn along with the apple stocks dataset with the extra features.

Это упражнение является частью курса

Anomaly Detection in Python

Посмотреть курс

Инструкции к упражнению

  • Create a list that contains the five numeric column names of apple.
  • Initialize a QuantileTransformer that casts features to a normal distribution.
  • Scale and store the five columns in to_scale simultaneously.

Интерактивное практическое упражнение

Попробуйте выполнить это упражнение, дополнив этот пример кода.

# Create a list of columns
to_scale = [____]

# Initialize a QuantileTransformer
qt = ____

# Scale and store simultaneously
apple.loc[____] = ____
Редактировать и запускать код