Master Categorical Data Encoding with Scikit-learn's OrdinalEncoder & OneHotEncoder πŸ“Š

Learn how to effectively convert categorical variables into numerical format using Scikit-learn's OrdinalEncoder and OneHotEncoder. Boost your machine learning models with these essential preprocessing techniques!

Master Categorical Data Encoding with Scikit-learn's OrdinalEncoder & OneHotEncoder πŸ“Š
learndataa
1.2K views β€’ Dec 17, 2020
Master Categorical Data Encoding with Scikit-learn's OrdinalEncoder & OneHotEncoder πŸ“Š

About this video

The video discusses the intuition and code to numerically encode categorical data using OrdinalEncoder() and OneHotEncoder() in Scikit-learn in Python.

Timeline
(Python 3.8)

00:00 - Outline of video
00:36 - What are categorical features?
01:30 - Why is there a need to encode categorical features?
03:09 - What are ordered categories?
04:09 - Code snippet
05:52 - Open Jupyter notebook
06:06 - Data
06:21 - OrdinalEncoder(): (default) categories='auto'
10:01 - OrdinalEncoder(): categories= -*custom order*-
12:30 - OneHotEncoder(): (default)
16:20 - OneHotEncoder(): specify list of categories
20:35 - OneHotEncoder(): handle_unknown='ignore'
22:27 - OneHotEncoder(): drop='if_binary'
26:25 - DictVectorizer(): one hot encode categories from a dictionary
29:21 - Collinearity: Matrix with determinant = zero
30:42 - Ending notes


########
# Data
########

game = [
['first', 'gold', 'top'],
['second', 'silver', 'middle'],
['third', 'bronze', 'bottom']
]


x = [
['football', 'helmet', 'ground'],
['basketball', 'shoes', 'net'],
['cricket', 'bat', 'pitch'],
['tennis', 'band', 'court']
]

h = [
['male', 'truck', 'blue'],
['female', 'car', 'green'],
['male', 'bike', 'gray']
]

plants = [
{'fruit': 'pear', 'weight': 178.},
{'fruit': 'pomegranate', 'weight': 250.},
{'fruit': 'cherry', 'weight': 5.}
]

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

1.2K

Likes

25

Duration

31:24

Published

Dec 17, 2020

User Reviews

4.5
(1)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.