March 2020
Beginner to intermediate
352 pages
8h 40m
English
Our linear regression model has now been successfully trained. Remember that we separated some data from our dataset for testing, which we intend to use to find the accuracy of the model. We will be using that to assess the efficiency of our model. R2-statistics is a common method of measuring the accuracy of regression models:
#check prediction score/accuracyregressor.score(X_test, y_test)
The output of this score() function is as follows:
0.5383003344910231
The score(y_test, y_pred) method predicts the Y values for an input set, X, and compares them against the true Y values. The value of R2 is generally between 0 and 1. The closer the ...
Read now
Unlock full access