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

R squared plot

In the previous exercise, you got an R squared value of 0.651. The R squared metric ranges from 0 to 1, 0 being the worst and 1 the best.

Calculating the R squared value is only the first step in studying your model's predictions.

Making an R squared plot is extremely important because it will uncover potential problems with your model, such as non-linear patterns or regions where your model is either over or under-predicting the outcome variable.

In this exercise, you will create an R squared plot of your model's performance.

The home_test_results tibble has been loaded into your session.

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

Modeling with tidymodels in R

ดูคอร์ส

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

  • Create an R squared plot of your model's performance. The x-axis should have the actual selling price and the y-axis should have the predicted values.
  • Use the appropriate functions to add the line y = x to your plot and standardize the range of both axes.

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

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

# Create an R squared plot of model performance
ggplot(___, aes(x = ___, y = ___)) +
  geom_point(alpha = 0.5) + 
  ___(color = 'blue', linetype = 2) +
  ___ +
  labs(x = 'Actual Home Selling Price', y = 'Predicted Selling Price')
แก้ไขและรันโค้ด