1. 学习
  2. /
  3. 课程
  4. /
  5. Practicing Statistics Interview Questions in Python

Connected

练习

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.

说明 1 / 共 3 个

undefined XP
  • 1

    Compute and print the R-squared score of our model using the score() function.

  • 2

    Compute and print mean squared error using the mean_squared_error() function.

  • 3

    Adapt your code to compute and print the mean absolute error this time using the mean_absolute_error() function.