Hellhole before going deep down to the station.
Let's have a quick recap of what we have done in all our previous session.
So we have basically performed several techniques of great art, namely the preprocessing we have process
our duration, golomb, arrival time feature, departure time feature and lots of feature as much so
in this session.
What we have to do, we have to handle our categorical data and we have to basically perform feature
encoding techniques on our data.
So this categorical data is exactly of basically two types.
The very first one is your nominal data.
The second one is your ordinary data.
So what exactly is this nominal data?
So what is this nominal data?
So normal data are basically those data that are not in any order, like the name of countries, the
name of country doesn't have any hierarchy, whereas ordinal data are basically those data that has
some kind of hierarchy like say good, better, best.
So they have some kind of hierarchy.
So whenever you have your nominal data in such case, you have to perform your one part encoding.
And whenever you have your ordinal data in such case, you have to use your label encoding plus or you
have to perform your label encoding.
So basically you have to deal with the categorical data either by one hot encoding or the one encoding.
And there are several techniques to deal with this categorical stuff like that.
So let's say what I'm going to do very first, Clexane in this Triniti, I'm going to past my list,
which is might get in a column to get all your data off your categorical let's say I'm going to store
it in a new database, which is exactly categorical.
So just executed.
And if I'm going to got a had on my data frame, you will get a preview.
How exactly you do that looks like it gives off.
All the features are exactly all categorical data type.
Let's say very first.
We have to deal with this Etheline feature.
That's what I am going to do for, let's say, on this categorical that if I have to access my airline
line and on this, if I'm going to call value count to get account of each and every feature available
in this Aalam, you will see this feature has that much on this feature, has that much on this feature,
has that much come.
Let's say you have to perform analysis between this airline feature and this feature.
Let's say you have to phone what exactly is a distribution of each and every airline with respect to
your price column.
So in such case, you can use a very handy plot box plot or you can use some of that broadnax, the
distribution plot or some plot.
But I'm going to show you very hard.
It got a very popular plot used in the street.
So to extract that, you have to use your Seimone library and form this.
You have to use your box lot.
And here on if I'm going to press shift plus that you will get all the documentation of its function.
What is your X?
What is it?
Why what is your data frame and all these things like that.
Let's say on my X, I have to say I have basically my all the different different categories of airline
and on why I need my price.
And what exactly is my data from my data from nothing but Kreen underscore data and we have to sort
this data as well.
Let's say I'm going to short this data on the basis of descending order.
So for this, you have to call this chart and its core value and here very fast, you have to say on
what basis you have to start it.
So I'm going to say I have to short it on a basis of procedure.
Then you have to set your standard parameter as far because you have to sort it on a basis of descending
order.
Let's say I'm going to set my own figure aside for this plot for the Spaceward.
For this you guys can use this particular figure.
And in this build or figure, you have a parameter which is exactly thickset.
And here you guys can set your own window, except I'm going to set my own window of 15.
Comfier.
So just executed it.
It will take a couple of seconds and it is a beautiful box.
But you will see with respect to Jacquier with this is exactly the distribution we are this is one line
because it is exactly twenty five percent datapoints.
Made sure this is your medium and this one shows this is seven percent data.
And from this box plot we can come up with the conclusion.
Yeah.
Jacqui, always business has the highest price, whereas all the other lines had almost the similar
media, if there is not a much fluctuation in all other airlines apart from this Jet Airways business
in a similar way, you can also perform this analysis with respect to your total.
Is Daubs feature, let's say is I am going to call this an escalator.
Dot had a there you will see a column name over here as total is let's say you have to extend.
Yeah.
What exactly the distribution of this to the top.
So for this I want to use this box plot and here this time on this x axis, you just need total on this
score is tops feature.
So what you have to do just executed.
And this is a beautiful box plot.
And you will see here with respect to one stop, you have some outlets and data.
It means flight.
Who has one stock who are just a single stop there, maybe have a higher fare than others, and you
will see a flight who has just for rest of their price isn't fluctuating very much.
So that's the inference how you can extract from the data, how you can extract from this or how you
can understand your data.
So now what we have to do, we have to basically convert this.
We have to convert this airline feature into some Intisar format because my machine learning isn't able
to understand.
Yeah, this is what exactly the meaning of this Endako, what exactly the meaning of this Eternia,
because it is obvious Jimm and machine learning just works on a mathematical equation.
It just works on some kind of Intisar data.
So we have to convert this into some into the format.
So far, this what I'm going to do for this airline, we are going to use a one hot encoding.
So to use redhot encoding, you guys could call a function, which is exactly I get underscored dummies,
which is exactly in your PARNAS module to just use this function.
And here you have to say on what column you have to perform it.
So I have to perform it on categorical of it, and then I'm going to pass the parameter drop and it's
equals cool.
Otherwise it will provide you some repetitions of columns.
Just a drop on the score first equals to true.
Let's say after doing this domestication it will return my data frame.
So I'm going to store it in the airline and just execute it.
And if on this airline I'm going to call that had over there, we will see all this feature gets dummy
fired and all these features have some Intisar data.
Now, what we have to do, we have to dummy fly this source column.
Let's see what I'm going to do and closed.
I have to access this source column, so I'm going to access it.
And on this source, if I'm going to call these columns, you will see over here, Delli has that much
number of those states.
Calcutta has that much.
Bangalore has that much.
Let's say I have to exact the distribution of this source with respect to price.
So in such case, I can again use this box.
But so this time I'm going to say on x axis, I have to just pass this source now I have to just execute
it and it will return this beautiful box and we will see over here.
Bangalore has the highest fluctuation in need and we will see what daddy has, definitely our highest
median compared to all other metropolitan cities of India.
And we will see what here.
This is exactly our distribution of Mumbai.
This is of Gené with respect to all other cities as well.
So now we have to dumphy this source column as well.
So far, this is what I'm going to do.
I'm just going to copy this and I have to just do some modification over here.
So this time I have to talk for source.
And here I have going to say I'm going to create a new data frame.
That's its name is sort and simple.
I'm going to call ahead on my data to get a preview how exactly this new screen looks like you will
see change for this this distally for this this Calicut for this this way for this this.
So we can clearly understand that.
Yeah.
Here my Bangalore is available.
It means wherever you have one, it means in that particular role, that particular data is available.
So now what we have to do after we find the source we have to do is find our destination as well.
So I'm going to say I have to.
The destination as well, so I'm going to say this is nothing but this one, and if I am going to call
our value conservative over there, so we will observe over here, it has that much number of count
with this number of this.
Let's say we have to extract what exactly is a distribution with respect to its price so far.
This what we guys can do.
We guys can copy the SAT and simple nothing.
We have to just based on what you can do, you can create a function it as well if you have to do work
in a much more smarter way.
So this time on X-axis, basically I have my destination feature, so just execute it.
And this is a beautiful box, but you will see or hear in case of New Delhi, wherever my New Delhi
destination.
So this is exactly our distribution of it means flights that are going to New Delhi that has the highest
bidder, whereas the flights that are going towards Calcutta has the lowest price you will observe over
here in the distribution of this Calcutta.
Now, what do you have to do?
You have to fly.
This destination so far is what I'm going to do.
Either you can copy or you can manually type with you.
So just to copy paste and this time I have to do my flight, basically my destination.
So I have to exit this destination.
That said, and this time I have to store all this stuff, let's say, in destination.
So I'm just going to store it in destination.
And this time I have to just press and just execute it.
You will see with respect to destination, you have this much data frame.
So in the upcoming session, we are basically going to deal with this road feature because you will
also over here, this column is a little bit messy.
So you have to do a lot of reporting in this column to fly this column.
So that's all about decision.
And hopefully you love the session very much.
Thank you, guys.
Have a nice day.
Keep learning.
Keep growing.
Keep practicing.