In this video, we are going to see how to tune the hyper barometer.
That is the cost barometer.
We will try to find out that value of this cost parameter, which can probably get us the best, best
set performance.
By the way, I hope that you are typing all this command on your own and not just watching these videos
or copy pasting from the file that I've shared with you.
I always recommend that your table with your own hand so that it stays in your memory for a longer time.
So tune the hyper barometer.
We have this tune function in the EU and Euro Zone one library only.
And this tune function with daily mortar to be used.
We tell the formula to be used.
So the first parameter is the model.
We want to use an SBM model here.
The second parameter is the formula.
Started gospel is the dependent variable are telecine and then are dark, suggesting that we want to
use all other variables as independent variables.
Then we have this data barometer.
We want to use the train data.
The canal is still linear.
We haven't discussed other types of canals.
And then we provide the range of the hyper parameter.
So I'm going to run this same analysis with a list of values of see, the value of sea will be changed.
The same model will be done again and again.
And this tuned out.
Our Breville will contain the information of how the error rate is changing when I'm changing the value
of see the error rate that we are considering.
Here is de cross-validation error rate that is within this training data set.
Our model will create some parts.
So by default it will create in part it will grindy the model on nine parts and it will test its performance
on the end part.
It will again, but under the same model on other main parts and test the performers on the remaining
paint part and agree do it 10 times since it has an individual part of the training set.
So by default, the number of parts it will create is 10.
If you want to change the number of parts that it will create, you can add one parameter which is called
Cross, which stands for cross validation set.
So you can add a barometer called Cross and specify the values and how many number of parts you want
to divide that train.
Well, for now, we'll use the default value of pain, only an elegant discom on.
Now you can see that there is a young dark out, very well created, which contains the information
of this tuning exercise that we did not to find out the best model out of all the all these different
models that we created.
We use this Dündar out dollar based model.
Come on.
So the best model is stored in this variable and that will be stored.
And this newly created variable, which will be best modeled.
So we store the information of best model in this best modality.
Will we then this.
Come on.
You can see that now I have another variable which contains the information of the best model.
This variable is same as the as Winfred variable.
Both of these have the model information of the Esmie a model.
So same as as being fake, you can use this model to predict on the test set and use those predicted
values to compare against the actual values and data set and then find out the prediction accuracy of
this model.
If you want to look at this best model, you'll under somebody's command.
If I scroll a little bit, you can see that out of all these cost values of point zero, one point one,
one ten and a hundred, the best value is coming at a cost of one.
This is the same model that is stored in the SBM fit also.
So if I predict the values on the desk, these will be the same values.
I store these values in a new variable called White Bread and says this is linear values prediction
and I'll create this confusion matrix again, which is the same confusion matrix that we got earlier.
Now, if you want to check out other values of cost.
So we know that the best is coming at one.
And if you want to look at the cost values, Nirvan, instead of looking at this huge range of point
zero zero one two hundred, we can give a range of point one point five point eight, one to ten and
two on.
So you can change this value range around this combined game and find out if there is any other cost
value at which we can get a better result than this.
So this is how using this tune function with the only hyper parameter, which is the cost parameter
in a linear kernel in the coming, Ludo's will move our discussion from linear gurnard to other nonlinear
commit.