Machine Learning Tutorial Python - 6: Dummy Variables & One Hot Encoding

Machine Learning Tutorial Python - 6: Dummy Variables & One Hot Encoding

codebasics

6 лет назад

388,123 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@rooshanghous6912
@rooshanghous6912 - 22.11.2023 03:17

This is an amazing tutorial! saved me so much time and brought so much clarity!!! Thank you!

Ответить
@kartikjha5704
@kartikjha5704 - 15.11.2023 15:02

@codebasics what if we have some new another category in test data set. How we can handly that.please reply.

Ответить
@ramakrishnayellela7455
@ramakrishnayellela7455 - 12.11.2023 12:53

The parameters in OneHotEncoder are updated their is no parameter of categorical_features and it gives an error like on OneHotEncoder their is no parameter like categorical_features can any one know solution

Ответить
@d.p.80
@d.p.80 - 09.11.2023 00:58

Hello,
Why we don't drop rows referring to the "west windsor" in first solution for the dummies? We drop column, but we don't drop rows contains data from dropped columns. Why last column? Can we drop , for example, the middle one? Anyone could me explain?

Ответить
@prakharpandey3239
@prakharpandey3239 - 02.11.2023 06:18

if anyone is getting the values in True and False in dummies variable just do this in " dummies = dummies.astype(int)" and they will get the values in "1"and "0"

Ответить
@antimuggle_ridhi2565
@antimuggle_ridhi2565 - 28.10.2023 15:29

did anyone try to plot this ? please share code

Ответить
@Yang11235
@Yang11235 - 11.10.2023 08:56

Hello brother, I am not completely understand why we need to drop one of the dummys column
he said if one of the column can derived we need drop one of them , it was a trap for training,
but I don't known why, can you help me understand the principle?

Ответить
@imanqoly
@imanqoly - 08.10.2023 00:29

I found my AI journey gold mine

Ответить
@zehrakhuwaja4231
@zehrakhuwaja4231 - 28.09.2023 10:23

I must say this is the best course I've come across so far.

Ответить
@kalaipradeep2753
@kalaipradeep2753 - 27.09.2023 17:20

In encoding feature method, How to find original value of numerical value....🤔

Ответить
@HashimAli-tz8fw
@HashimAli-tz8fw - 09.09.2023 21:56

I achieved the same result using a different method that doesn't require dropping columns or concatenating dataframes. This alternative approach can lead to cleaner and more efficient code

df=pd.get_dummies(df,
columns=['CarModel'],drop_first=True)

Ответить
@nenunaachef1504
@nenunaachef1504 - 26.08.2023 12:23

There is no such attribute categorical_features. What can we use ???

Ответить
@aftabmalik2669
@aftabmalik2669 - 17.08.2023 12:23

Use .astype(int) to convert boolean to integers in get_dummies like
pd.get_dummies(df.town).astype(int)

Ответить
@ZOSELY
@ZOSELY - 11.08.2023 18:54

I wish I could give this videos 2 thumbs up! Great explanation of all the steps in one-hot encoding! Thank you!!

Ответить
@jaychotalia7542
@jaychotalia7542 - 10.08.2023 11:37

ohe = OneHotEncoder(categorical_features = [0]).
This line is throwing error on colab, anyone with the solution ?

Ответить
@Richard_Shaju
@Richard_Shaju - 06.08.2023 19:18

You are a Gem

Ответить
@abhinavb717
@abhinavb717 - 27.07.2023 21:54

I am getting 84% accuracy without encoding variable, but after encoding i am getting 94% accuracy on model. Thank you for your teaching. Doing great Job

Ответить
@pranav9339
@pranav9339 - 21.07.2023 08:32

Accuracy is coming out to be 94% change. Is it correct?

Ответить
@PankajKumar-cl4xn
@PankajKumar-cl4xn - 19.07.2023 11:14

accuracy- 0.94%

Ответить
@jayasreecarey7843
@jayasreecarey7843 - 17.07.2023 22:36

Many Thanks ! Great Explanation :)

Ответить
@Quest_adventure
@Quest_adventure - 22.06.2023 18:59

I could not get the difference

Ответить
@SohamPaul-xy9jw
@SohamPaul-xy9jw - 20.06.2023 08:57

In the step:
ohe = OneHotEncoder(categorical_features=[0])
The categorical features isn't working, the attribute has been changed. Can someone help?

Ответить
@ayanabhade7109
@ayanabhade7109 - 05.06.2023 17:41

please update this video. The categorical_feautures[ ] argument is no more there in updated OneHotEncoder. They use column_transformer.

Ответить
@rahulbhagat4023
@rahulbhagat4023 - 29.05.2023 21:20

How do I draw a scatter plot with multiple variables?

Ответить
@milorad42
@milorad42 - 27.04.2023 04:18

Hi, I've been looking for an understanding of what neural networks mean for a long time, as a hobby, and I only found the answer in your videos, but please help me with a question. How can a contextual neural network be implemented, let's say I have a bird X, but I also have a sound that bird X makes, a sound processed by another neural network. How can two neural networks, one that knows the image and one that plays the sound of the bird, confirm to me in a context that it is a bird X? I appreciate your attention

Ответить
@mathsbysherazi2134
@mathsbysherazi2134 - 22.04.2023 16:07

Pls give data link

Ответить
@YashPatel-hs7gl
@YashPatel-hs7gl - 13.04.2023 08:49

Sir
I got dummy colums value in form of boolean .. true or false

How I can get value in format 0 or 1

Ответить
@ramanandr7562
@ramanandr7562 - 10.04.2023 19:21

Thank you sir🎉. You made my ML Journey Better.. 🤩

Ответить
@user-bp7go9gr2s
@user-bp7go9gr2s - 23.03.2023 21:18

can we use either one for encoding ? or is there a deciding factor of when to use one hot encoder and when to use dummy encoding ?

Ответить
@owonubijobsunday4764
@owonubijobsunday4764 - 15.03.2023 08:39

❤🎉🎉 Thank you. You earned a subscriber

Ответить
@halibrahim
@halibrahim - 08.03.2023 19:01

Great tutorial, but the code is outdated; starting from version 0.20, OneHotEncoder no longer accepts categorical_features as a parameter. Instead, you should use the ColumnTransformer class to specify which columns in your input data should be one-hot encoded. Here is a more updated code

from sklearn.preprocessing import OneHotEncoder
from sklearn.compose import ColumnTransformer
# define the column transformer
ct = ColumnTransformer([('encoder', OneHotEncoder(), [0])], remainder='passthrough')

# fit and transform the input data
X = ct.fit_transform(X)

Ответить
@mapa5000
@mapa5000 - 08.03.2023 14:33

You make it easy with your explanation !! Thank you !!

Ответить
@mukul29099
@mukul29099 - 07.03.2023 21:19

how we select number for prediction anyone please reply

Ответить
@armghan2312
@armghan2312 - 07.03.2023 19:32

pandas dummies is better in my opinion

Ответить
@nationhlohlomi9333
@nationhlohlomi9333 - 21.02.2023 03:23

A PLACE TO RUN TO WHEN ONE IS STUCK, THANK UOU SO MUCH SIR

Ответить
@shaikhkashif9973
@shaikhkashif9973 - 16.01.2023 20:29

Age_Catg such as young, adult , old. comes under ordinal or nominal pls answer anyone??

Ответить
@tushargahtori1570
@tushargahtori1570 - 06.01.2023 02:42

Even in 23 your video is such a relief..kudos to your teaching.

Ответить
@Dim-zt5ei
@Dim-zt5ei - 31.12.2022 13:36

Great videos! Unfortunately it becomes harder and harder to code in the same time as the video because there are more and more changes in the libraries you use. For example sklearn library removed categorical_features parameter for onehotencoder class. It was also the case for other videos from the playlist. Would be great to have the same playlist in 2022 :)

Ответить
@subee128
@subee128 - 27.12.2022 13:45

Thanks

Ответить
@manasaraju8552
@manasaraju8552 - 02.12.2022 14:11

difficult topics are easily understood, Thank you so much for the content sir

Ответить
@mensahprince9533
@mensahprince9533 - 30.11.2022 11:09

OneHotEncoder(catergorical_features=[0]) is deprecated?

Ответить
@LamNguyen-nm1id
@LamNguyen-nm1id - 28.11.2022 06:12

update 2022: use columntransformer for your categorical column with OHE

Ответить
@jayshreedonga2833
@jayshreedonga2833 - 25.11.2022 08:44

thanks sir nice lecture
sir you are really a great teacher
you teach everything so nicely
even tough thing becomes easy when you teach
thanks a lot

Ответить
@omharne1386
@omharne1386 - 22.11.2022 12:10

I will say this is one of the best tutorial i have seen in ML

Ответить
@ManuelCurral
@ManuelCurral - 08.11.2022 14:33

Since the latest build of sklearn library removed categorical_features parameter for onehotencoder class. It is advised to use ColumnTransformer class for categorical datasets. Refer the sklearn's official documentation for futher clarifications.

Ответить