Handle Categorical features using Python

  Рет қаралды 33,510

Krish Naik

Krish Naik

Күн бұрын

Пікірлер: 46
@HrishikeshShinde495
@HrishikeshShinde495 4 жыл бұрын
This is the simplest way of encoding the categorical features. Thanks man!!
@programsolve3053
@programsolve3053 7 ай бұрын
Well explained🎉🎉
@ishmeetsinghrayat
@ishmeetsinghrayat 2 жыл бұрын
you explain like pro bro.....
@sreedharsree361
@sreedharsree361 4 жыл бұрын
Thanks krish for this video .. I have a doubt, at last part of the video .. while converting from categorical feature to numerical feature 2001 pincode represented at one instance as 1 and at other instance it is represented as 0 .. on what basis we represented like this ?
@amylock8275
@amylock8275 2 жыл бұрын
Exactly what I was looking for! Thank you
@ABCEE1000
@ABCEE1000 2 ай бұрын
which is better The Hark method you mentioned at the end or feature hashing ? if feature hashing is efficient may you explain it in another video?
@nikhilshingadiya7798
@nikhilshingadiya7798 4 жыл бұрын
what happen if we have all independent variable as categorical i.e. movies data set country origin,movie_type,director now i want to predict the imdb missing data how can i handle those categorical variable
@aanniirr100
@aanniirr100 2 жыл бұрын
how can we save the count of a particular category obtained to be used later in any calculation
@timothythampy7202
@timothythampy7202 3 жыл бұрын
Thank you so much, sir! You are the best teacher
@louerleseigneur4532
@louerleseigneur4532 3 жыл бұрын
Thanks Krish
@UnstoppableBird
@UnstoppableBird 4 жыл бұрын
thank you so much, this is actually clearer than the stupid class I enrolled earlier
@MrKB_SSJ2
@MrKB_SSJ2 2 жыл бұрын
Thank you so much... It was so easy...
@priyak1008
@priyak1008 3 жыл бұрын
How to apply onehot encoding if we have categorical data in Y (dependent column).
@ranoyavanniysingam3390
@ranoyavanniysingam3390 3 жыл бұрын
if we have more than 5 categorical-feautures column, what to do for that? for example -- country, age group like this?
@swaruppanda2842
@swaruppanda2842 5 жыл бұрын
At 17:08 u made it clear for 2001 as 1 as output will be 2/3=0.6 what about 2001 as 0 as output?
@aakashsinghrawat3313
@aakashsinghrawat3313 4 жыл бұрын
actually the idea is getting mean of 2001, suppose 2001 has value 1 and 0 obvious mean will be 0.5 for both
@slowhanduchiha
@slowhanduchiha 4 жыл бұрын
One Question Sir. I was working on a classification dataset. My out put variable is also categorical in nature . I applied OHE and later when i saw the heatmap it made no sense because the columns were bit blank. Correct me where i am wrong here
@dilipgawade9686
@dilipgawade9686 5 жыл бұрын
Hi Krish, can you show how to convert categorical variable to numeric variable through coding ?
@inderpreetkaur1441
@inderpreetkaur1441 4 жыл бұрын
I want to create box plot for categorical variable (like subscribed: yes/no) Firstly I wrote the code: train= pd.get_dummies(train['subscribed'], drop_first=1) And then for creating box plot: train['subscribed'].plot.box() But this will show error as- keyword: 'subscribed' Please let me know my mistake.
@51kaushal
@51kaushal 4 жыл бұрын
Kris, but what if we have a regression problem then we would not have output as 0/1, then how do we encode the categorical features like pincode, do we use frequency/count encoding in there??
@SuperJg007
@SuperJg007 3 жыл бұрын
what to do if there is mixed data, continuous and categorical?
@somnathbanerjee2057
@somnathbanerjee2057 4 жыл бұрын
Hi Krish, could you please guide me how can I handle text column for a regression problem. It's not about encoding categorical features. But what I am looking for is---extracting some meaningful information from the existing column containing text data using string manipulation method from regex...Please recommend me an effective way of doing this.
@nashrakhan5361
@nashrakhan5361 4 жыл бұрын
getting key error for the column which I used for categorical data, please help
@simanchalpatnaik2566
@simanchalpatnaik2566 5 жыл бұрын
Thanks for the video Krish. When I ran the "df" command after concating, why all the values of Florida & New York comes as "NaN" ?
@surbhisarawagi1821
@surbhisarawagi1821 5 жыл бұрын
If we have large number of categorical variables say 21, then if we use get dummies we'll have large number of columns so how to deal such a case?
@gurjotsingh752
@gurjotsingh752 5 жыл бұрын
are u able to find, how to cater your problem ie 21 categorical variables?
@aakashsinghrawat3313
@aakashsinghrawat3313 4 жыл бұрын
i think, we can use feature_selection like SelectKBest to get top k(any N no. upto total columns) which means these new features have strong relationship with target
@gurjotsingh752
@gurjotsingh752 4 жыл бұрын
@@aakashsinghrawat3313 yes, your approach is good. I also find one more approach. Here we will replace categorical values with their number of count. Eg) We have 29 states. and suppose we have 10K records and Delhi has come 500 times, Karnataka come 900 times. So, i will replace delhi by 500 and Karntaka by 900.
@aakashsinghrawat3313
@aakashsinghrawat3313 4 жыл бұрын
@@gurjotsingh752 isn't it inefficient to labelling 500,900 to categorical feature? This method might be good to ordinal features.
@vipinamar8323
@vipinamar8323 3 жыл бұрын
What is the last encoding type called?
@alimisumanthkumar2769
@alimisumanthkumar2769 3 жыл бұрын
mean encoding
@aakashsinghrawat3313
@aakashsinghrawat3313 4 жыл бұрын
can someone please give me link of solved example using target encoding, mean encoding like above
@satishakuthota6290
@satishakuthota6290 5 жыл бұрын
please make video on visuvalistion using matplotlib
@chaithanyaravi8400
@chaithanyaravi8400 4 жыл бұрын
Hi Krish, suppose in the case if we have 8 categorical names at that time it will generate 8 new columns?
@aakashsinghrawat3313
@aakashsinghrawat3313 4 жыл бұрын
yes
@arjyabasu1311
@arjyabasu1311 5 жыл бұрын
Sir, please upload a video on how to perform mean encoding !!
@sahanjayarathne3472
@sahanjayarathne3472 4 жыл бұрын
Thank you so much for the video
@ijeffking
@ijeffking 5 жыл бұрын
Thank you Krish.
@parakhsrivastava7743
@parakhsrivastava7743 5 жыл бұрын
I have a doubt... When dealing with categorical values having many classes, you took all 2001's and find out the probability where O/P is 1. Suppose, that is coming 0.6(as in video). Now you are replacing all 2001's with 0.6, no matter O/P is 0 or 1... WHY? Should we not replace 2001's by 0.6 only if O/P is 1, else replace it with 0.4? Thanks for the video btw!
@swinal9710
@swinal9710 5 жыл бұрын
The O/p column comes from where can you explain me that?
@theeagleseye4989
@theeagleseye4989 5 жыл бұрын
Same doubt here
@sahilkamboj747
@sahilkamboj747 5 жыл бұрын
@Premjith Augustine what if the output is not a classification variable. Target variable can be Continuous like Price, Fees,Profit
@aakashsinghrawat3313
@aakashsinghrawat3313 4 жыл бұрын
that 0.6 is mean for 0 as well as to 1
@ankita684
@ankita684 4 жыл бұрын
Hi Krish.. I wrote exactly the same codes simultaneously to practice, but my score came out to be -5.667 (I got a negative value) whereas you got 0.9304. I am not able to understand why am I not getting the same value. Please explain.
@krishnaik06
@krishnaik06 4 жыл бұрын
Just set the seed once
@vijaynale7893
@vijaynale7893 5 жыл бұрын
Thanks bro
Linear Regression Mathematical Intuition
24:17
Krish Naik
Рет қаралды 22 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Linear expansivity explained
8:34
Knowledge Base
Рет қаралды 1
Handling Missing Data Easily Explained| Machine Learning
23:22
Krish Naik
Рет қаралды 191 М.
How do I encode categorical features using scikit-learn?
27:59
Data School
Рет қаралды 139 М.
One-Hot, Label, Target and K-Fold Target Encoding, Clearly Explained!!!
15:23
StatQuest with Josh Starmer
Рет қаралды 57 М.
7 Python Data Visualization Libraries in 15 minutes
15:03
Rob Mulla
Рет қаралды 86 М.
Finding an outlier in a dataset using Python
16:24
Krish Naik
Рет қаралды 198 М.
Feature Selection Techniques Easily Explained | Machine Learning
23:01
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН