How it works...

In Step 1, the k-fold cross validator splits the dataset into K consecutive folds with K=10. The k-fold cross-validator provides us with the train and test indices and then splits the data into training and testing subsets. In Step 2, we looked at the coefficient of determination using r2_score() and the mean squared error using mse(). The coefficient of determination and the mean squared error are 79% and 12.85, respectively. In Step 3, we plotted the predicted values against the actual values of the response variable, mpg

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset