Download Free Audio of Let's run the cell. Here, we can see that the bl... - 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:

<speak> Let's run the cell.<break strength="x-strong"/> Here, we can see that the blue color line is the training score.<break strength="x-strong"/> And the orange color is the test score. <break strength="x-strong"/> Here the k value 11 has good accuracy.<break strength="x-strong"/> We are getting a 100% training score for k=1.<break strength="x-strong"/> I think this may be because of overfitting.<break strength="x-strong"/> But here, we can see that for k=11, <break strength="x-strong"/>we have crossed 75 % of accuracy. <break strength="x-strong"/> So let's use k=11 and again build a model. <break strength="x-strong"/> So, we fit the model on x train and y train.<break strength="x-strong"/> And then we are predicting on x test and y test.  <break strength="x-strong"/> Now let's plot the decision boundary.<break strength="x-strong"/> Let's check the plot.<break strength="x-strong"/> Remember, the k nearest neighbor algorithm is <break strength="weak"/>based on the local geometry of the distribution of data.<break strength="x-strong"/> A classifier is linear<break strength="weak"/> if its decision boundary on the feature space is a linear function.<break strength="x-strong"/> In general, Positive and negative examples are divided by a hyperplane.<break strength="x-strong"/> With k N N, you don't have a hyperplane in general.<break strength="x-strong"/> Here, we can see that the decision boundary is nonlinear.<break strength="x-strong"/> So here we can see that few values are mixed.<break strength="x-strong"/> Here one in orange color indicates a person has diabetes.<break strength="x-strong"/> And 0, the blue color means a person doesn't have diabetes. <break strength="x-strong"/> The boundary line is not accurate here. <break strength="x-strong"/> </speak>