So let us have a look at the solution on this particular problem.
So here we are.
First of all, important, the important libraries and we have also got the data set into this data
frame.
And this is the data that we have, the satisfaction level, last evaluation number of project abridgment,
the time spent in the company, Wilcockson, live promotion and all of the goals which we just discussed
in the last review.
So let us suppose to have a look at the value column so that we can see what is the distribution of
our target.
So our target value is having value zero and one zero means that person has not left the company, and
one means that the person has left the company.
And here you can clearly see that there are on seven thousand doors, which has that person does not
leave the company, but three thousand rooms where the person needs the company.
So when we look at the issue, it is two point four, which implies that there is a huge difference
between these.
So probably we will have to have a weighted classification.
So next we will have a look at different columns.
So there are only two columns which have objected to all of the non numerical columns.
So the objective, they are the sales and salary.
So next thing which we will be doing is on what is in the military.
So this is the same code which you have seen several times.
So we are converting this into a dummy variable.
So we have converted into inside the column into dummy variable.
Now, when we have a look at the shape of this particular data, we there are in Saudi in columns and
around 10000 rows of it.
Next, we are getting the data in two extreme and widely by dropping the left column from D.C.I and
keeping only the left column from here in the extreme right.
Next is just simply a code which will give you a report of the model, which we have just run.
And next, what we are doing here is we are learning different parameters, which we have, for example.
So here I am simply implementing X Eustachy.
You will be implementing different algorithms and comparing amongst them.
So this is the process which we will be following.
You will be implementing different algorithms of logistic regression decision trees, random 460 most
of my ways as.
You will try all of those and then find out which works best on this particular dataset.
And after that, you will be fine tuning that particular model.
If it still does not perform, then you will be stacking different models.
So these are different type of parameters which are present in extreme boost.
What I have done here is I have first of all, implemented a randomized so Steube you'll find out how
my model would actually perform and I have completed my to within so that out of so many combinations
or nithin combinations will be created and I will be getting the model performance out of only this
Benwood.
So I'm simplifying the model and got the report out of the report.
States that I have eighty three percent accuracy here.
Next is eighty three point seven three point six.
So the best one comes out to be three point seven.
And these are the barometers which I have obtained from this now to finding this particular model,
I will be applying these sequential parameter.
So what I have done here is I have selected one parameter at a time or two or three parameters, ultrafine,
and then I am simply fine-tuning each and every parameters like that.
So first, I have been the number of investigators.
I have seen the model and Gwatney Disvalue regarding that.
So once they get the model, I get then the end estimate of nine hundred looks.
But even then an estimated one hundred also looks very big.
So what we do is we select something which we find is useful enough.
So that is not much difference between the an estimate estimated.
Nine hundred and a hundred.
So we are thinking 500 because that is a good number for investigators.
Right.
We will be fine.
So what we do for that is we will make the learning rate again.
And here I have just kept morning zero point one and I will be picking of the gamein max depth value
and fine tuning what these two parameters.
So yeah, I have fixed the learning rate and we did and subsamples and I am fine tuning on top of it.
And then I get these values regarding the parameters.
I get the max to be 12.
I'm gonna do it next again.
I will fix these two values.
I'm fine doing some other parameters and so on.
This cycle would keep on going.
So this is something that you will have to work own.
And finally, when I keep on doing this entire process again and again, I end up with various values
for these hyper parameters, which I keep fixing.
And at the end I am left with an optimized model.
So here you can see the mean validation is eighty four point one.
When I look at the next one here, again, the mean validation is eighty four point one with standard
deviation zero point zero two one.
If we compare this from the previous one here, we have zero point equal one with the meanwhile standard
deviation of zero point zero one seven.
Here we have zero point eight four zero with standard deviation of zero point zero zero.
So if you compare between these different models, you can pick out any model out of these where we
have this eighty four point one, which seems to be a better one and select that particular model next.
What I'm doing is I am simply getting the best model out of it.
And from the best model, I will simply find out the cross validation score.
So these are different cross-validation scores for this particular model and I am getting the mean and
standard deviation out of to the mean that a school comes out with three point sixty six and the standard
deviation comes out to be zero point one one.
So this is my model.
I have for you did you can try a different strategy, different importance of them together and create
your own model of what this looks like, a good base for defense.