Okay, so let's say after we create our model after we train our model from this classification algorithm, prediction algorithm, or regressions or algorithms, or these are clustering algorithms. So how do we evaluate our model? So for let's say regressions all those are prediction model, we can use our r square, or the sum of square of residue or sum of squared error and total sum of squares to evaluate our model to see how accurate our model is. So far, these are some r square residue or sum of squares error is that area. That will be easy to understand. So let's say we have a actual y minus the predicted y Then we square the whole thing.
So, we have the error and then we sum everything. So, we sum all the rows that we have actually are predicted and then we will get a total error. So, this will be the sum of squared residuals sum of square then for r square is small for this simple linear regression. So you for r square will be one minus SS E divided by SST So, SST will be the sum of Y minus the mean of why, and then from these SST and SS, our SS E, we can calculate the R square. And we can use all these to see how accurate our model is or what is the error in our model. So far these are so, S e SS and SS T or r square is more for prediction.
So our prediction is more for predicting those continuous or numerical variables. So if we are predicting ESEA categorical variables, and that is classification, we can use a confusion matrix to evaluate the accuracy of our model. So let's say we predicted No. We predicted yes the actual no the actual Yes. So we predicted no and the answer is also know. We have Pt repre data, yes.
But there actually is no, there is a right hand. we predicted No, the answer is yes, there is a rock fi. we predicted Yes, the answer is yes, there is around 110. From this confusion matrix, we can calculate a sum here. So we'll be picking plus 1065 plus one or 105 10 plus 1110 Vt plus 585. So in this confusion matrix, we can calculate the accuracy and precision and we can also calculate a recall.
So true positive is predicted yes and they have the disease shown activities are predicted no and they don't have the disease. false positive predictor yes and no and they don't have the disease. Pause possible negatives predicted nobody had the disease. So we can use all these two are calculator accuracy and precision.