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

Model performance metrics

Evaluating model results is an important step in the modeling process. Model evaluation should be done on the test dataset in order to see how well a model will generalize to new datasets.

In the previous exercise, you trained a linear regression model to predict selling_price using home_age and sqft_living as predictor variables. You then created the home_test_results tibble using your trained model on the home_test data.

In this exercise, you will calculate the RMSE and R squared metrics using your results in home_test_results.

The home_test_results tibble has been loaded into your session.

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

Modeling with tidymodels in R

ดูคอร์ส

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

  • Execute the first two lines of code which print the home_test_results. This tibble contains the actual and predicted home selling prices in the home_test dataset.
  • Using home_test_results, calculate the RMSE and R squared metrics.

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

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

# Print home_test_results
home_test_results

# Calculate the RMSE metric
home_test_results %>% 
  ___(___, ___)

# Calculate the R squared metric
home_test_results %>% 
  ___(___, ___)
แก้ไขและรันโค้ด