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

Making predictions on new data

Finally, the model you fit with the train() function has the exact same predict() interface as the linear regression models you fit earlier in this chapter.

After fitting a model with train(), you can simply call predict() with new data, e.g:

predict(my_model, new_data)

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

Machine Learning with caret in R

ดูคอร์ส

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

Use the predict() function to make predictions with model on the full Boston housing dataset. Print the result to the console.

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

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

# Predict on full Boston dataset
แก้ไขและรันโค้ด