LoslegenKostenlos loslegen

Regression evaluation

The test_set and model objects that you have derived in the previous exercise are available in your environment.

It's useful to present the accuracy of predictions with one number. You can then easily compare several models and show the progress to your employer or future employer.

Root Mean Squared Error and Mean Absolute Error are widely used to evaluate the regression models. Recall that their formulas are:

\(RMSE = \sqrt{\frac{1}{n} \sum_{i=1}^{n}(y_i - \hat{y}_i)^2}\)

\(MAE = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i|\)

Diese Übung ist Teil des Kurses

Practicing Statistics Interview Questions in R

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Assign Hwt from the test set to y
___ <- test_set$___

# Predict Hwt on the test set
___ <- ___(model, newdata = ___)

# Derive the test set's size
___ <- nrow(___)
Code bearbeiten und ausführen