herek wk aa ) = xic bk anq ) with tr being the trace of matrix operatorn being the number of data points in our datacq being the set of points in cluster qcq being the center of cluster qc being the center of eand nq being the number of points in cluster thankfully we can calculate this index without having to calculate this complex formula by leveraging scikit-learn higher score normally indicates that the clusters are dense and well separatedwhich relates to the general principles of clustering models km _chi metrics calinski_harabaz_score(xkm _labelskm _chi metrics calinski_harabaz_score(xkm _labelsprint('calinski-harabaz index for num clusters= 'km _chiprint('calinski-harabaz index for num clusters= 'km _chicalinski-harabaz index for num clusters= calinski-harabaz index for num clusters= we can see that both the scores are pretty high with the results for five clusters being even higher this goes to show that just relying on metric number alone is not sufficient and you must try multiple evaluation methods coupled with feedback from data scientists as well as domain experts evaluating regression models regression models are an example of supervised learning methods and owing to the availability of the correct measures (real valued numeric response variables)their evaluation is relatively easier than unsupervised models usually in the case of supervised modelswe are spoilt for the choice of metrics and the important decision is choosing the right one for our use case regression modelslike classification modelshave varied set of metrics that can be used for evaluating them in this sectionwe go through small subset of these metrics which are essential coefficient of determination or the coefficient of determination measures the proportion of variance in the dependent variable which is explained by the independent variable coefficient of determination score of denotes perfect regression model indicating that all of the variance is explained by the independent variables it also provides measure of how well the future samples are likely to be predicted by the model the mathematical formula for calculating is given as followswhere is the mean of the dependent variabley indicates the actual true response valuesand indicates the model predicted outputs nsamples nsamples