Download Free Audio of Welcome to the lesson on model training. Now let... - 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> Welcome to the lesson on model training. <break strength="x-strong"/>Now let's start building our model. <break strength="x-strong"/> First, we will start with the k nearest neighbors algorithm.<break strength="x-strong"/> First, we will create an empty list with the name train scores <break strength="strong"/>and another list with name test scores.<break strength="x-strong"/> We will obtain the optimal k value <break strength="strong"/>for the k nearest neighbors algorithm.<break strength="x-strong"/> We are choosing k values from 1 to 15.<break strength="x-strong"/> Thus, for each k value from 1 to 15, we will run the K N N algorithm. <break strength="x-strong"/>After running the algorithm for all these values, find scores corresponding to them.<break strength="x-strong"/> For this, we are creating a loop. <break strength="x-strong"/>In this for loop, k values are from 1 to 15.<break strength="x-strong"/> We use K Neighbors Classifier to train the model. <break strength="x-strong"/> We have created an instance of the K N N Classifier.<break strength="x-strong"/> We have trained the model using the fit method on the X train and Y train.<break strength="x-strong"/> For i in range 1 to 15, our model will try models from 1 to 15, and it will select the best neighbor.<break strength="x-strong"/> And then, we are appending the scores of models to these test scores and train scores lists. <break strength="x-strong"/> Let's run the cell.<break strength="x-strong"/> So we have created the loop.<break strength="x-strong"/> And we have stored scores in the train scores list and test scores list.<break strength="x-strong"/> Let's check the training scores list.<break strength="x-strong"/> </speak>