Welcome back.
So while you were gone in between the last video and this one I've kind of tidied up this data dictionary
here.
So it looks a bit better now.
And don't worry you'll have a copy of this in the resources section so you're not going to be missing
out on anything but just where we left off.
We talked about features which is step four in the machine learning pipeline that we're using on the
machine learning modelling pipeline that we're using.
And this is where you'll get different information about each of the features in your data.
You can do this by doing your own researchers researchers by doing your own research such as looking
at the links above.
That's what I did here to kind of tidy this up.
Reading between this information here to attribute information as well as UCI data set web page.
If you go through here.
Here are all 76 attributes but realistically we only used 14 so only 14 attributes used and that's what
this data dictionary is.
So basically a data dictionary just tells you about the data that you're working on.
Wonderful.
And so now where are we up to.
If we check back we've worked through one two three four but have we really.
So we've we've just kind of done it in thought.
So now it's time to apply the tools that we've been going through to this section rights in this data
analysis section.
So let's do that let's get our tools ready.
So create a heading here preparing the tools.
We're going to use Panda's map plot lib and name PI for data analysis and manipulation.
Wonderful.
And so at the start of every notebook what you might do is import.
This is what you'll probably see out in the wild is a big chunk or one big Jupiters cell importing all
different tools at once.
You don't necessarily have to do it this way but it's kind of industry standard to do it this way.
So let's see what that would look like.
Import all the tools we need.
So what we might do is make little subheadings here.
So that way when we're working through this step by step process we've got all the tools that we need.
And now again a project might not start out like this I'm only doing it this way because this is what
you'll see with this sort of finished project.
What you're more regularly do is kind of how we've been working with it in the past is just import a
tool as you need it.
So when you see this big block of code that I'm about to type with all the imports and all different
tools and whatnot you might look at and go holy goodness I'm not sure what's going on with everything
there but that's okay.
What you'll do is because you've got the framework now you've got this.
And we've seen different ways that we can apply different tooling.
You'll be pretty familiar with all the functionality that we're going through here.
And if not that's perfectly okay.
You know where to look and you know where to get help.
So let's do this we'll go regular a D.A. and plotting libraries.
Here's where we're going to import name pi EDI A stands for exploratory data analysis by the way.
Got to learn not to talk in acronyms where your code is like to shorten everything so important.
Num pi as MP import panders as PDA import mat plot lib dot pie plot as party at party.
Come on Daniel.
Import seaborne as S and S so seaborne remembers just that plotting library build on top of the map
plot lib map plot lib is the base plotting library that we're gonna be using.
So we're going to do map plot lib in line because we want our plots to appear inside the notebook.
So this is what this little magic function does with that percentage sign there.
And then we want to import models from my skyline so I can't line.
Also known as SDK line you're about to see that in a second.
So from S K learn we want a linear model implored logistic regression.
Now if you're wondering where these models came from remember we've got cyclic loan model map choosing
the right estimate of wonderful so we follow this along in a previous section we're working on a classification
problem.
So we're only gonna be importing classification models.
So from S.K. loan dot neighbors we're also going to import another model here.
So kind neighbors classifier
and you remember this one on some you might not have seen the first two but that's okay.
We'll talk about then when we when it comes to it random forest classifier we have seen that one and
then we're going to go model evaluations we're going to go from S.K. learn dot model selection import
train test split.
This is gonna help us split our data into training and test sets.
We'll also import cross vowel score from here.
Now if you're wondering how I know all these it's because I've had some practice.
And if you're all looking at this I'm going Holy goodness there's a lot of things to remember it important
you like.
Well that's what I'm saying.
I'm agreeing with you that machine learning is a very broad field and there's a lot of different ways
to do similar things.
But after some hands on practice like what we're going through now you'll start to get a bit more familiar.
And again it's no rush.
I still have to look up things so I've done these on separate lines.
These two I could have done them on the same line because they're from the same module.
But just to keep it a little bit tidy a little bit polyphonic.
We want to go hear from S.K. learned metrics.
Import confusion matrix classification report.
Well they may be familiar from the evaluation section of the socket loan section.
We go here.
Import.
We want to get precision score because we're thinking in our head.
This is a classification problem.
What metrics can we use to evaluate classification models.
If one score from S.K. loan metrics import plot ROIC curve because we want to Roc curve while you might
be looking at that go and Daniel that is a lot of stuff.
And it truly is this is twenty one lines of imports minus a few comments.
But this is the tools that we're going to need.
So if we come back here we may still even need more I might have missed some but this is kind of what
you'll see at the start of a notebook is because once you've set it up you want to approach these and
we want to minimize our time between experiments.
So that's why we're getting all our tooling ready right at the top so that we can get hands on as soon
as possible.
So we've got pandas we've got that plot label we've got num pi we're working with the energy put a notebook
in our condo environment we've got socket loan and now we're going to work through the data analysis
section.
So that means basically importing the data having a look at it and trying to become ourselves a subject
matter expert which is just someone who knows about the data like a fancy word for someone who knows
about the data.
That's what we're trying to do in these three steps here.
So without further ado let's hit shift and enter import our tools fingers crossed.
If we've set up our environment to work they should all import correctly.
What do we get in here.
Something wrong runtime error.
MP Hugh funk size change may indicate binary incompatibility expected 1 9 2 from C and I got to 16 from
pi object.
I've actually never seen that error before.
So this is what you come across right.
These type of things even after you've had some experience you'll come across these things.
This warning so we're just waiting on to make sure that this cell runs fully.
It's already given us a warning or we're getting another warning here again.
MP though you fund now we might let this cell run out as in Finnish because you're gonna take a little
while.
Unrecognised arguments maybe I can't put this this needs to go above here.
Maria will this import.
Yes it should.
And now we're getting no warnings.
Huh that's interesting.
Well that's the surprises that you'll get from day to day running working with different machine learning
code and different code in general.
Sometimes it does things that you don't really expect.
And so that warning has gone away.
If it does come back in the future we'll probably deal with it then but for now we'll assume that we've
got our tools ready now we can start applying them.