Good day everyone in this segment.
We're going to look at the project nature and we're going to make use of the various algorithm that
we've played with or have been explored ourself then and apply it to this IBM major analytics employee.
And this is of course from Cagle.
Do have a read through.
There are more information here for you to actually glance through and I know that we've touched on
this before so I'm going to go through this a little bit quickly now.
One part of the data is that we do need to import the data.
Let me just upload the file.
This is obviously from your local station could be in your desktop or it could be an office sitting
in a folder or a thumb drive.
Just make sure that it is available for you to upload as and when you're ready.
So once you're actually uploaded to the server then we can read into memory and we just need to do a
few of tidying up which we've shown you before.
And also in terms of the converting some of the string into one hard encoding.
Right.
The next portion then is to perform train tests split and we're going to import our decision tree classifier
instantiate it and perform the actual fitting itself.
And that's run our training and tests.
So this is the actual test here.
It comes out seventy nine point three five results.
Clearly not that satisfactory.
We want to actually compare this to the ensemble method.
So let's start with the.
Let me just delete that accidentally added that line of code.
Begging classifier so the usual we are using the classifier from before with words from before which
is this one here.
So we're using decision tree and we actually name it S.O.S.
So now we are actually using that as a base estimate for our begging classifier.
So let's conduct the fitting and then run the actual train and test to see our outcome.
Now this is the one part I do need you to remember for a test score origin or test scores seventy nine
point three five.
Let's see if begging improve it.
Seventy nine percent.
Okay.
Just remember that.
Seventy nine percent.
I need to remember that myself as well.
Let me just jotted down
OK.
Welcome back.
Looking at this you can see therefore for the test score the accuracy score has improved to eighty two
point six one percent.
So originally we have our decision tree of the using begging the process to it improved the eighty two
point six one.
And what about if we actually use random for us as our classifier so let's run random for us and run
this again train and test.
Okay so random for us on its own is already eighty four point two for better than the begging of our
classification or decision tree.
Of course we can actually view the importance in terms of the the important features as set up by a
random forest.
It does highlight that monthly income age total working out years these other things that's important
predictor when it comes to the the likelihood of the staff attrition.
Okay so let's take it one step further and look at abuse and again we're using just standard parameters.
Okay so there's nothing extremely different there for this.
You notice the average score for edibles has improved to eighty six point nine six percent.
So it's an improvement of random for us.
Now what happens if we combine the two.
So let me just run that by explaining what we did here.
So we can use the posting method which is edible this year but using random for us as the classifier
based classifier or base estimate I should say.
So looking at this eighty four point five one there's no improvement of the edibles on its own which
is edibles with decision tree so random for us plus edibles didn't actually improve the performance
at all.
Of course you shouldn't just look at this you should look at the average accuracy plus the standard
error and to see if it actually is an improvement.
Eighty six point four eight vs. eighty six point four.
So it's the same but the difference however is that the standard deviation has dropped when you actually
use a combination of edibles and random forest though the accuracy did not improve the margin of error
in terms in the form of a sudden deviation on volatility has gone down.
Okay.
So don't be this bears or sometimes pays to compare all the matrix that it's generated.
So now let's look at gradient boosting classifier.
So let me run that and while we explain a little bit of what we actually running here.
Base estimate is we use 100 again we're fitting it and just look at the output here.
Eighty six point four one.
Marginal it's around there there's really a major improvement but in terms of the accuracy it does seem
to have improve to the edibles plus random for us.
Remember this is about.
That is one point eight versus one before.
OK it's about there.
All right down next how much difference there.
So next one is look at X Cuba is now a ship which does take a while to land.
Let me run those and come back an extra explain a little bit.
We're using 100 to estimate.
These are just very standard instantiating and fitting.
And now let's look at the output.
So with extra books is eighty five point eighty seven.
No really no major improvement there.
Accuracy and also sound division is also around there as well.
So this is a really quick flow through in terms of what we did here for this project is that we have
looked at Decision Tree bagging random for us at a booth with decision tree at a booth with random for
us.
And finally you boys were basically train 6 models really really quickly.
Reasonable we can actually do that really quickly partly because of the of how we're using teepee you
here thanks to Google I'm using your hands.
The actual training is so fast and tested so fast as well.
Now of course the data that we looked at is not very large either so that way that's why the process
is so quick.
But if you want to take this one step further to improve the accuracy towards the 90 percent you do
need to tune.
You do need to do a grid search.
You also need to
place more training on your unbalance because these data is quite an imbalance.
If you look at the 0 60 substantially smaller.
So you do need to actually allowed the AML the algorithm to train a bit more so you noticed the difference
here 180 2 2 9 2 2.
So that's the part because it's fairly unbalanced.
Most algorithm will struggle with this or you might have to use either mechanism to overcome this unbalanced
class problems.
OK.
Thank you once again for watching.