Now that we've got all our tools ready to go the first step is to load the data in because without data
how we're supposed to use our tools right.
So we go here load data make a little heading then we're going to settle as DFS IDF is usually short
for data frame so aid read see as V because we've got our heart disease CSB folder in our current working
directory we can just go PD don't read CSB we're gonna pass it can we do tab auto complete heart disease
dot CSB BEAUTIFUL AND THEN WE'RE GONNA HAVE A LOOK AT IT WONDERFUL THAT SEEMS LIKE IT'S IMPORTED great
we've already had a sneak peak in this before but we might go dot shape this is going to tell us how
many rows and columns there are so essentially we have 303 examples which is rows and this is columns
so this comes in the form of rows columns.
Now once we've got data loaded in what's next well that comes Data Exploration a.k.a. known as exploratory
data analysis or EDTA.
Once you've imported the data say this is where you want to go to start to explore it.
Now there's no set way of doing this but what you should be trying to do is become more and more familiar
with the data so you can compare different columns to each other.
Compare them to the target value refer back to the data dictionary try and figure things out what your
goal is is to become a subject matter expert on the data set that you're working with.
So the goal here is to find out more about the data and become a subject matter expert on the data set.
You're working with now.
This is because if someone asked you a question about it you can give them an explanation.
And when you start to build models you can soundcheck your model to make sure they're not performing
too well such as like overfishing or they might be poorly performing such as under fitting now since
EDTA has no really set methodology.
What we're gonna do we'll write down a short checklist so we can go what questions are you trying to
solve.
So this is back to our problem definition and then what kind of data do we have.
And how do we treat different types.
So this is like numerical versus categorical.
In our case all the data in our data frame is numerical.
Now remember these steps aren't just associated with the heart disease data set.
They can be applied to almost any data centers.
What's missing from the data.
And how do you deal with it.
Step Four where are the outliers and why should you care about them.
Now outliers are values or samples which are so far away from the other samples like in terms of if
you were comparing one sample to another.
If one sample was just completely outlandish it might be an incorrect like sample that someone may have
made a mistake when they were looking man or it may be an incorrect sample or just full stop.
Or it may actually be that that's just an outlandish example and it should be included in your dataset.
Then finally and again this is a non exhaustive list.
How can you add change or remove features to get more out of your data.
So it's kind of like a EDTA checklist that you might want to start with as a bare minimum of what we're
trying to figure out.
How about we do that.
So the first thing might check DNA head traditional way of looking at a data frame if we wanted to look
at the bottom.
We might do DFT tail wonderful and then the next thing because we're trying to predict this target variable.
We want to figure out what's some information about that.
So we go IDF target maybe we use this one.
Remember this two different ways to access columns and data frames you go IDF dot target or IDF target
as a string called value counts on that.
So we'll go here.
Let's find out how many of each class there are.
So in our case if we go back out to our data dictionary and trying to figure out what Target is we can
see.
Target is have disease or not.
So 1 equals yes zero equals no so there we go.
So we have 165 examples where someone has heart disease based on their health parameters and 138 examples
where someone doesn't have heart disease.
And so what we would think here is that this is a relatively balanced problem meaning that we have quite
a similar amount of examples in both classes.
So that's a balanced classification problem.
And so if we go here maybe we want to visualize this.
So if we go IDF target value counts because we're always trying to be as explanatory we want to explain
the data in a way that both we and other people can understand and visualizations are one of the best
ways to do that.
So kind equals maybe a bar graph and then we'll pass it some fancy colors so that we know this is our
graph.
We'll trademark these colors light blue salmon and light blue.
Let's see this I'll put a little semicolon here.
So that output doesn't come up.
There we go.
Maybe we could relabel these as something maybe that might involve changing the values in the data frame
we won't do that for now.
If we wanted to share this with someone we could relabel that is heart disease and no heart disease
the next thing we might want to look at is different information about our data frame so we can do that
with D after info what are the other columns got in them.
Are there any missing values.
So this is what this is going to tell us.
So we have age which is a known now in 64.
This 14 column 302 entries sex is in 64.
C.P. what CPE member we can check our data dictionary come up here.
Chest pain type.
Okay.
Typical that angina atypical and Jena not actually sure what what n Jena means.
So this is where we're trying to figure out what our data is all about.
So define n Jena a condition marked by severe pain in the chest.
That makes sense if we're dealing with heart disease data.
OK so if we come back.
See there's no real structure to this like we're just kind of jumping back and forth.
If it seems like we're bouncing around it's because we actually are.
And another way to see is there any missing values.
IDF is in a some.
Because remember one of our questions in exploratory data analysis is what's missing from the data and
how do we deal with it.
So are there any missing values in our case.
There is not.
So we don't have to do anything about the missing values there.
Then if we're still trying to find out more about how data frankly might do DFT describe which is gonna
give us some numerical values about all of our columns.
So we've got count here which is three and three that's how many rows there are.
We get the main value of age.
So that means the main value of all of our patients here is 54.
We come through here.
Okay.
That's not too much there that we can really make use of for now what we might start to do is compare
different columns.
So we'll probably save that for the next video.
So save this one getting too long.
So now we've got some quick quick insights about the data.
Right.
No real structure here we're just trying to figure out what's going on we've read the column headings
here we've compared them to our data dictionary.
We've seen how many examples of each target there are in this graph here.
This visualization.
Now we're going to start to compare different columns and try and get a bit more of an idea of where
the patterns are within our data.
So let's do that in the next video.