เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Removing correlated predictors with recipes

Removing correlated predictor variables from your training and test datasets is an important feature engineering step to ensure your model fitting runs as smoothly as possible.

Now that you have discovered that monthly_charges and avg_data_gb are highly correlated, you must add a correlation filter with step_corr() to your feature engineering pipeline for the telecommunications data.

In this exercise, you will create a recipe object that removes correlated predictors from the telecommunications data.

The telecom_training and telecom_test datasets have been loaded into your session.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Modeling with tidymodels in R

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Specify a recipe object
telecom_cor_rec <- recipe(___,
                          data = ___) %>%
  # Remove correlated variables
  ___(___, threshold = ___)
แก้ไขและรันโค้ด