Metrics for Evaluation

  1. Calculate the following metrics: mean absolute error, mean squared error, root mean
    squared error, and the R2 score. Use the following code samples:
    print('Mean Absolute Error:', metrics.mean_absolute_error(y_test,
    y_pred))
    print('Mean Squared Error:', metrics.mean_squared_error(y_test,
    y_pred))
    print('Root Mean Squared Error:',
    np.sqrt(metrics.mean_squared_error(y_test, y_pred)))
    print(‘R-squared Score:’, regressor.score(X, y))
    Part 2: Model Refinement
  2. Rerun the linear regression model from Module 4, but change the percentage of records
    that are used for testing. Try using 0.25 and 0.3.
  3. Calculate the same metrics from above.
  4. Use a scatter plot to visualize all three models.
  5. Evaluate the three models. Are any of them underfit or overfit? Which % of testing data
    performed best?