Skip to content

PRO TIP Block youtube.com at the DNS level โ€” Pi-hole, NextDNS or your hosts file โ€” but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

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

504.5K views on YouTube

Machine learning models work very well for dataset having only numbers. But how do we handle text information in dataset? Simple approach is to use interger or label encoding but when categorical variables are nominal, using simple label encoding can be problematic. One hot encoding is the technique that can help in this situation. In this tutorial, we will use pandas get_dummies method to create dummy variables that allows us to perform one hot encoding on given dataset. Alternatively we can use sklearn.preprocessing OneHotEncoder as well to create dummy variables.

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

Code in tutorial: https://github.com/codebasics/py/blob/master/ML/5_one_hot_encoding/one_hot_encoding.ipynb

Exercise csv file: https://github.com/codebasics/py/blob/master/ML/5_one_hot_encoding/Exercise/carprices.csv

Exercise solution: https://github.com/codebasics/py/blob/master/ML/5_one_hot_encoding/Exercise/exercise_one_hot_encoding.ipynb

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)

Do you want to learn technology from me? Check https://resources.codebasics.io/Igmopd for my affordable video courses.

Next Video:
Machine Learning Tutorial Python – 7: Training and Testing Data: https://www.youtube.com/watch?v=fwY9Qv96DJY&list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw&index=7

Populor Playlist:
Data Science Full Course: https://www.youtube.com/playlist?list=PLeo1K3hjS3us_ELKYSj_Fth2tIEkdKXvV

Data Science Project: https://www.youtube.com/watch?v=rdfbcdP75KI&list=PLeo1K3hjS3uu7clOTtwsp94PcHbzqpAdg

Machine learning tutorials: https://www.youtube.com/watch?v=gmvvaobm7eQ&list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw

Pandas: https://www.youtube.com/watch?v=CmorAWRsCAw&list=PLeo1K3hjS3uuASpe-1LjfG5f14Bnozjwy

matplotlib: https://www.youtube.com/watch?v=qqwf4Vuj8oM&list=PLeo1K3hjS3uu4Lr8_kro2AqaO6CFYgKOl

Python: https://www.youtube.com/watch?v=eykoKxsYtow&list=PLeo1K3hjS3uv5U-Lmlnucd7gqF-3ehIh0&index=1

Jupyter Notebook: https://www.youtube.com/watch?v=q_BzsPxwLOE&list=PLeo1K3hjS3uuZPwzACannnFSn9qHn8to8

To download csv and code for all tutorials: go to https://github.com/codebasics/py, click on a green button to clone or download the entire repository and then go to relevant folder to get access to that specific file.

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

๐ŸŒŽ My Website For Video Courses: https://resources.codebasics.io/Igmopd

Need help building software or data analytics and AI solutions? My company https://www.atliq.com/ can help. Click on the Contact button on that website.

#๏ธโƒฃ Social Media #๏ธโƒฃ
๐Ÿ”— Discord: https://discord.gg/r42Kbuk
๐Ÿ“ธ Codebasics Instagram: https://www.instagram.com/codebasicshub/
๐Ÿ”Š Codebasics Facebook: https://www.facebook.com/codebasicshub
๐Ÿ“ Codebasics LinkedIn: https://www.linkedin.com/company/codebasics/
๐Ÿ“ฑ Codebasics X handle: https://twitter.com/codebasicshub
๐Ÿ“ธ Dhaval’s Instagram: https://www.instagram.com/dhavalsays/
๐Ÿ“ Dhaval’s LinkedIn: https://www.linkedin.com/in/dhavalsays/
๐Ÿ“ฑ Dhaval’s X handle: https://x.com/dpcodebasics
๐Ÿ”— Patreon: https://www.patreon.com/codebasics?fan_landing=true