MulaiMulai sekarang secara gratis

Regression evaluation

Let's revisit the linear regression model that you created with LinearRegression() and then trained with the fit() function a few exercises ago. Evaluate the performance your model, imported here as lm for you to call.

The weather data has been imported for you with the X and y variables as well, just like before. Let's get to calculating the R-squared, mean squared error, and mean absolute error values for the model.

Latihan ini adalah bagian dari kursus

Practicing Statistics Interview Questions in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# R-squared score
r2 = ____
print(____)
Edit dan Jalankan Kode