Hello, all so in all the previous session, we have analyzed our data and we all have understand our
data in a very proper way.
This is exactly the trend from where my other guests are, what exactly the distribution of the prize
and how exactly the prices of a room that I am in, which month my guest is higher.
We all have analyzed this trend as well.
So that's a time for your machine learning aspect.
Now, the very first task with respect to your machine learning approach is exactly you have to select
some important features using correlation concept for your machine learning model.
So if you guys don't know what exactly the correlation, kindly follow my all the previous video that
I have uploaded.
So let me call ahead on my data so that I will get a quick overview of how exactly my data looks like.
So this is exactly my data on which I have to find our correlations.
So to find correlation, you have to just call a function which is exactly C Odawara.
So just execute it.
So it will give us this amazing metrics with respect to each and every feature.
You have some correlation.
And this is exactly like, of course, you will see with respect to this is cancer, to cancer.
You have a coalition of one because it makes no sense at all having correlation between same features.
Whereas with respect to is cancer, you have a coalition of zero point two nine.
It means if this lead-time value increases, there is a twenty nine percent probability that this is
cancer and also gets increased.
That exactly is an exact meaning of this correlation.
So now what I have to do, basically, I just need my correlation with respect to this is cancer.
So far.
This what we can do here?
I'm just going to say data don't call correlation.
And here I have to just paste over there.
And if I'm going to execute it, it will hit on this amazing stage with respect to all the correlation
value with respect to this is canceled because it's cancer is exactly my independent feature that we
have to predict whether booking is going to be canceled or not.
So we can easily figure out over here how all these variables are going to impact on this is canceled
feature.
It means how all these variables are going to impact how my bookings are going to cancel or not.
So this is the exact meaning of this coalition.
So let's see.
This is exactly my very first over here.
Let's say this is exactly my correlation.
And after it now we have to simply pretend this coordination.
That's it.
And this is exactly the final correlation value that you have to take care of it.
Let's say I have a shot this so far, this what we guys can do.
Very first, let me just add to this call this correlation.
And on this, if I'm going to call this absolute, because I have to neglect this negative and positive
as well.
So I have to just call this absolute and let me just execute all this.
You will see all your positive and negative gas disappeared.
And now on this, I have to just call this short on a score, Riluzole, just to execute all your stuff.
So let's say I have to shorten in my descending order.
So for this, I would say ascending.
It goes to four.
That set just execute.
And it is your amazing steps over here that you really need to take care of it, from which you have
to extract some meaningful and amazing insights.
So from this correlation value, you can directly say that this time, this total number of special
request, these required car, all these things are my most important features, that we have to take
care of it because its coordination is definitely high.
Let's say I have to understand this data is too.
So for this, what we guys can do, let's say with respect to this dependent variable, I have to know
with respect to this is concerned how many gas we have that have Check-Out that have canceled and that
doesn't have any showboating.
So for this what we can do, we can see DataDot will buy.
So basically we have to group our data on the basis of this is underscore cancel.
So I'm going to say I have to group on the basis of this one, then I have to accept this reservation
is status, which is exactly a column, which is I would say reservation and a score is.
And on this, I have to simply call my value, so I'm just going to say, well, you underscore council
are just executed and it is this amazing.
You will see when your booking isn't going to cancel.
And reservationist, who does this check out?
You have that much number of guest.
And when your booking is going to cancel and your reservation status is canceled, then you have that
much number of guests and it is no sure you have that much number of guests.
So you can simply understand your data.
Yeah, there are a higher number of customers there, a higher number of guests who are going to check
out.
Let's say I have to fetch my numerical features and my categorical features separately from all these
features.
So very first, I have to exclude some variables.
So I'm going to do final list, let's say list on a score.
Not so.
The very first variable that I have to exclude in my modeling purposes is exactly my days in waiting
list.
So the question that will come across your mind why I have to exclude this, because this is that feature
that is never going to contribute, whether a booking is going to cancel or not.
And you can definitely see what here.
It is also a very low correlation value.
It means it is not going to impact that much on my model.
So I have to basically excluded after it.
We have to exclude, let's say, arrival, underscore date in a school year.
So I have to exclude this one as well.
After what I have to do now, I have to just execute it.
Now we have to fetch how many numerical features we have or how many numerical columns we have.
So for this, I'm just going to say for column in DataDot columns, I have to basically iterate on each
and every column.
Then I'm going to put a condition over here.
Rather, the data type of that particular column must not be object.
So I'm going to say data column dot data type, doesn't it, to object.
That is exact meaning of this one.
And if this commission will satisfy, I'm basically going to consider that column.
But still, I have to let's say I have to exclude this one.
So I'm going to add the condition as a. column, not in whatever list I have defined, which is exactly
list and a score.
Not so this is exactly my entire code of list comprehension.
And if you guys are not that much comfortable with this list comprehension code, so you what you can
do, you can say it is for data and columns.
Let me show it there.
So you have two very first.
Add this condition after eight, you have to add this one and after it you have this condition and this
one.
So here I am going to say this is nothing but this one.
And once I have all this stuff, then I am simply going to append in my list very first.
I have to define some list.
Let's say these are my let's say I'm going to define list as calls.
So I'm going to say calls, dot, pen, whatever column I have.
And now I have to simply print my course list.
So it is basically for those one who are not that much confortable with this list comprehension code,
because whenever you are going to form from real words, then add use.
You have to always write your optimised code.
You can't write down lines of code, one hundred lines of code.
You have to always optimize your code because more the number of lines of code have more the resources
it will take.
So let's say I'm going to name this list as numerical underscore features just executed.
Let's say I have to print my numerical features as well.
So now you will see these are all the features that are exactly my numerical features.
So on this feature, I can do a lot of people sitting.
Let's say that there is some outliers in or not.
So on these features, we can still do lots of people.
And if you guys still not much comfortable with this code, you can definitely go ahead with this logic.
But try to work on this list comprehension code, because once you will win in your industry use case,
you have to always write such a optimized code.
That's why I'm going to recommend you follow this approach.
So let me cross the cell.
And once I have all this stuff, what I have to do, let's say I just need my some categorical features
as well.
Let's say I have to exclude some categorical columns as well.
So.
Me, show me all the columns, so DataDot columns, these are exactly all the columns over here that
make the final list very false and colonoscope not.
And in this list, the very first is exactly my arrival on a score date and a score here, which is
exactly this one.
So I'm going to say this is the very first feature that I don't have to consider in my model building,
because this is exactly that feature that now would impact your model that much.
So the second feature is exactly your assigned room type, which is exactly this one.
So I'm going to say this is exactly my second feature.
After it, we have our booking changes column, which is exactly this one.
So I'm going to say this is exactly my, let's say, third column that I have to exclude after what
we have to do.
We have some other columns, which is exactly my reiterations status.
So I'm going to say this is nothing but my reservation is status after eight.
What we have to do, we have something known as a country because country never impacts that much on
my model building up.
To some extent it will impact, but they are up to a greater extent.
It will now impact that much.
And the second column that I have to exclude is exactly my days in waiting list.
So yeah, that will never impact that much.
So I have to just place over there once.
I will please let me just print my all these things.
So these are all the columns that I have to exclude.
So now what I have to do, I just need some categorical features.
So far this I'm just going to say for column in data dot columns and I have to put a condition if data
of column dot daytimes whosever column has a data type of object.
So I'm going to say equally cause to object, if this condition will get satisfied, then only I am
going to consider it in my list.
And still you have to add one more condition and column.
Not in it.
Me, that column must not be in my cat on score, not list.
So that is my entire Codal again list comprehension.
So if you guys are not that much comfortable, you can definitely write that code that I have written
over just one or two minutes before using my tools that I have shown you.
So here I have to say, let's say here I'm going to say this is exactly my categorical Alesco features
just executed.
So now I have to simply print.
So these are my all the categorical features that we have to take care of it.
So hope you love the session and you find this session very valuable and helpful for you.
Thank you.
Have a nice day.
Keep learning.
Keep growing.
Keep practicing.