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

preview_player
Показать описание

#MachineLearning #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #OneHotEncoding #sklearntutorials #scikitlearntutorials

Topics that are covered in this Video:
0:00 Introduction
0:47 How to handle text data in machine learning model?
1:38 Nominal vs Ordinal Variables
2:44 Theory (Explain one hot encoding using home prices in different townships)
3:39 Coding (Start)
3:51 Pandas get_dummies method
7:48 Create a model that uses dummy columns
12:45 Label Encoder
13:29 fit_transform() method
15:40 sklearn OneHotEncoder
19:59 Exercise (To predict prices of car based on car model, age, mileage)

Next Video:

Populor Playlist:

Tools and Libraries:
Scikit learn tutorials
Sklearn tutorials
Machine learning with scikit learn tutorials
Machine learning with sklearn tutorials

#️⃣ Social Media #️⃣
Рекомендации по теме
Комментарии
Автор

I have watched only 4 mins so far i had to pulse and write this comment. I will say this is one of the best tutorial i have seen in data science. Sir you need to take this to another level. What a great teacher you are

celestineokpataku
Автор

Hi,
Your explanation is very simple and effective
Ans for practice session A)Price of Mercedes Benz -4Yr old--mileage 45000= 36991.31721061

B)Price of BMW_X5 -7Yr old--mileage 86000=11080.74313219
C) percent)

venkatesanrf
Автор

For anyone stuck with the categorical features error.

from sklearn.compose import ColumnTransformer
ct = ColumnTransformer([("town", OneHotEncoder(), [0])], remainder = 'passthrough')


X = ct.fit_transform(X)


X


Then you should be able to continue the tutorial without further issue.

TheSignatureGuy
Автор

Sir pls continue your machine learning tutorials, yours tutorials are one of the best I have seen so far .

jhagaurav
Автор

Anyone can be a teacher, but real teacher eliminates the fear from students .. you did the same !! Excellent knowledge and skills

sreenufriendz
Автор

I was confuse from where to start studying ml and then my friend suggested this series.... It's great :-)

Genz-or
Автор

This guy is AMAZING! I have spent 2 days trying decenes of other methods and this is the only one that worked for my data and didnøt come as an error, this guy totally saved my mental sanity, I was growing desperate as in DESPERATE! Thank you, thank you, thank you!

noubaddi
Автор

Merc: 36991.317
BMW: 11080.743
Score: 94.17%

ankitparashar
Автор

Wonderful Video.
This so far the easiest explanation I have seen for one hot encoding. I have been struggling from very long to find a proper video on this topic and my quest ended today.
Thanks a lot, sir.

vaishalibisht
Автор

15:50 write your code like this:

ct = ColumnTransformer(
[('one_hot_encoder', OneHotEncoder(categories='auto'), [0])],
remainder='passthrough'
)
X = ct.fit_transform(X)
X

Ok so it will work fine otherwise it will give an error.

programmingwithraahim
Автор

Your ability to simplify things is amazing, thank you so much. You are a natural teacher.

tech-n-data
Автор

this ML tutorial is by far the best one i have seen it is so easy to learn and understand and your exersise also helps me to apply what i have learn so far thank you.

shrutijain
Автор

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

tushargahtori
Автор

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)

HashimAli-tzfw
Автор

You have gift of explaining things even to the layman. Big Up to you

wangangcwayi
Автор

you really made it very easy to understand such new concepts, Thanks a lot
starting from mint 12:30 about OneHotEncoder . Some udpates in Sklearn prevent using categorical_features=[0]

here is the code update as of April 2020
from sklearn.preprocessing import OneHotEncoder
from sklearn.compose import ColumnTransformer
columnTransformer = ColumnTransformer([('encoder', OneHotEncoder(), [0])], remainder='passthrough')
X = np.array(columnTransformer.fit_transform(x), dtype = np.str)
X= X[:, 1:]
model.fit(X, y)
model.predict([[1, 0, 2800]])
model.predict([[0, 1, 3400]])

ymoniem
Автор

First of all, 1000*Thanks for sharing such content on youtube..
I got an accuracy of 94.17% on training data.

bandhammanikanta
Автор

I was shocked after the first 5 minutes of the video and have never thought it would be so easy and fast! Thanks ALOT1

mk
Автор

the god of data explanation sir..kudos to your patience in explanation

hiver
Автор

This was really well done! Kudos to you! It's hard to find clear and concise free tutorials nowadays. Subscribed and hope to see more awesome stuff!

snomad