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

Fit model on reduced blood-brain data

Now that you've reduced your dataset, you can fit a glm model to it using the train() function. This model will run faster than using the full dataset and will yield very similar predictive accuracy.

Furthermore, zero variance variables can cause problems with cross-validation (e.g. if one fold ends up with only a single unique value for that variable), so removing them prior to modeling means you are less likely to get errors during the fitting process.

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

Machine Learning with caret in R

ดูคอร์ส

คำแนะนำการฝึกหัด

bloodbrain_x, bloodbrain_y, remove, and bloodbrain_x_small are loaded in your workspace.

  • Fit a glm model using the train() function and the reduced blood-brain dataset you created in the previous exercise.
  • Print the result to the console.

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

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

# Fit model on reduced data: model
model <- train(
  x = ___, 
  y = ___, 
  method = "glm"
)

# Print model to console
แก้ไขและรันโค้ด