2. 6x
"Coming up with features is difficult, time-consuming, requires expert knowledge. “Applied machine
learning” is basically feature engineering." ~ Andrew Ng
Feature Engineering
“… some machine learning projects succeed and some fail. What makes the difference? Easily the
most important factor is the features used.” ~ Pedro Domingos
“Good data preparation and feature engineering is integral to better prediction” ~ Marios Michailidis
(KazAnova), Kaggle GrandMaster, Kaggle #2, former #1
”you have to turn your inputs into things the algorithm can understand” ~ Shayne Miel, answer to
“What is the intuitive explanation of feature engineering in machine learning?”
13. Categorical Encoding – Target mean encoding 𝑓 𝑛 example
6x
x = frequency
k = inflection
point
f = steepness
https://www.researchgate.net/publication/220520258_A_Preprocessing_Scheme_for_High-Cardinality_Categorical_Attributes_in_Classification_and_Prediction_Problems
14. Categorical Encoding - Target mean encoding - Smoothing
6x
Feature Outcome
A 1
A 0
A 1
A 1
B 1
B 1
B 0
C 1
C 1
x level dataset 𝜆
A 4 0.75 0.77 0.99 0.99*0.75 + 0.01*0.77 = 0.7502
B 3 0.66 0.77 0.98 0.98*0.66 + 0.02*0.77 = 0.6622
C 2 1.00 0.77 0.5 0.5*1.0 + 0.5*0.77 = 0.885
𝜆 =
1
1 + exp (−
𝑥 − 2
0.25
)
x level dataset 𝜆
A 4 0.75 0.77 0.98 0.98*0.75 + 0.01*0.77 = 0.7427
B 3 0.66 0.77 0.5 0.5*0.66 + 0.5*0.77 = 0.715
C 2 1.00 0.77 0.017 0.017*1.0 + 0.983*0.77 = 0.773
𝜆 =
1
1 + exp (−
𝑥 − 3
0.25
)