in the scikit-learn packagethis can be calculated by using the _score function by supplying it the true values and the predicted values (of the output\response variablemean squared error mean squared error calculates the average of the squares of the errors or deviation between the actual value and the predicted valuesas predicted by regression model the mean squared error or mse can be used to evaluate regression modelwith lower values meaning better regression models with less errors taking the square root of the mse yields the root-mean-square-error or rmsewhich can also be used as an evaluation metric for regression models the mathematical formula for calculating mse and rmse is quite simple and is given as followsn mse samples nsamples in the scikit-learn package the mse can be calculated by invoking the mean_squared_error function from the metrics module regression models have many more metrics that can be used for evaluating themincluding median absolute errormean absolute errorexplained variance scoreand so on they are easy to calculate using the functions provided by the scikit-learn library their mathematical formulae are easy to interpret and have an intuitive understanding associated with them we have only introduced two of them but you are encouraged to explore other sets of metrics that can be used to regression models we will look at regression models in more detail in the next model tuning in the first two sections of this you learned how to fit models on our processed data and how to evaluate those models we will build further upon the concepts introduced till now in this sectionyou will learn an important characteristic of all machine learning algorithms (which we have been glossing over till now)their importanceand how to find the optimal values for these entities model tuning is one of the most important concepts of machine learning and it does require some knowledge of the underlying math and logic of the algorithm in focus although we cannot deep dive into extensive theoretical aspects of the algorithms that we discusswe will try to give some intuition about them so that you are empowered to tune them better and learn the essential concepts needed for the same the models we have developed till now were mostly the default models provided to us by the scikit-learn package by default we mean models with the default configurations and settings if you remember seeing some of the model estimator object parameters since the datasets we were analyzing were essentially not tough-to-analyze datasetseven models with default configurations turn up decent solutions the situation is not that rosy when it comes to actual real-world datasets that have lot of featuresnoiseand missing data you will see in the subsequent how the actual datasets are often tough to processwrangleand even harder to model henceit is unlikely that we will always use the default configured models out of the box instead we will delve deeper into the models that we are targetinglook at the knobs that can be tuned and set to extract the best performance out of any given models this process of iterative experimentation with datasetmodel parametersand features is the very core of the model tuning process we start this section by introducing these so-called parameters that are associated with ml algorithmsthen we try to justify why it is hard to have perfect modeland in the last section we discuss some strategies that we can pursue to tune our models