logo
Loading...

Machine Learning Tutorial Python - 6: Dummy Variables & One Hot Encoding - codebasics - 機器學習 Machine Learning 公開課 - Cupoy

Data Science Full Course For Beginners | Python Data Science Tutorial | Data Science With Python Ma...

Data Science Full Course For Beginners | Python Data Science Tutorial | Data Science With Python 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... Exercise csv file: https://github.com/codebasics/py/blob... Exercise solution: https://github.com/codebasics/py/blob... 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)