Download Free Audio of Welcome to the lesson on model evaluation. The la... - Woord

Read Aloud the Text Content

This audio was created by Woord's Text to Speech service by content creators from all around the world.


Text Content or SSML code:

Welcome to the lesson on model evaluation. The last step is the model evaluation. We will see different error metrics for the trained model. We have trained the model and want to check how it is performing. We want to evaluate whether it is predicting accurately or not. There are different error metrics like mean square error, mean absolute error, and root mean squared error. First, we will check the root mean squared error. Now we are importing mean squared error. The most commonly used metric is the root mean squared error. So we are importing mean squared error from the metrics class of sci-kit-learn library. What is root mean squared error (RMSE)? Root mean squared error (RMSE) is the square root of the average of the square of all of the errors. The output is stored in the pred_train variable. The sqrt method is useful to find the square root. The sqrt method is available in the NumPy library. We find the square root of the average of the square of all of the errors. train_y is the actual values of the output for the input. pred_ train is the predicted value from the model. That means the difference between predicted and actual value will be squared and sum together and take the square root. We are getting an error of 0.056 error for training and validation. For the testing data, we are getting an error of 0.062. For the training and testing data, we are getting enough scores. So our model is performing well. There is another measure which we can use for checking performance. It is R2-score. R2-Score or R-squared values range from 0 to 1 and are commonly stated as percentages from 0% to 100%. We use lr.score to measure R2-score. We pass training data and testing data to calculate R2-Scores. With training data, we are getting 82% accuracy. With testing data, we are getting 79% accuracy. Hence our model is performing well. You can continue deploying this model for building a real-time application.