1、 Feature Engineering&Selection for Explainable Models A Second Course for Data Scientists Md Azimul Haque Contents Foreword i Before We Start ii Section I:Introduction 1 Chapter 1:Introduction 2 1.1 Terminology 2 1.1.1 Dataset,Variable,and Observation 3 1.1.2 Feature Engineering 3 1.1.3 Feature Extr
2、action 4 1.1.4 Feature Selection 4 1.1.5 Cost Function 4 1.2 Process of Training a Machine Learning Model 4 1.3 Preventing Overfitting 5 1.4 Code Conventions 7 1.5 Datasets Used 7 1.5.1 Hotel Booking Demand Datasets 7 1.5.2 Car Sales 7 1.5.3 Coupon Recommendation 10 1.5.4 Raman Spectroscopy of Skimm
3、ed Milk Samples 10 1.5.5 Beaver Body Temperatures 10 1.6 References 10 Section Il:Feature Engineering 11 Chapter 2:Domain Specific Feature Engineering 12 2.1 Introduction 12 2.2 Domain-Specific Feature Engineering 12 2.2.1 Ask Probing Questions 12 2.2.2 Literature Review 13 2.3 References 14 Chapter
4、 3:EDA Feature Engineering 15 3.1 Introduction 15 3.2 Car Sales 15 3.3 Coupon Recommendation 21 3.4 Conclusion 29 Chapter 4:Higher Order Feature Engineering 30 4.1 Engineering Categorical Features 30 4.1.1 Dummy Encoding or One-Hot Encoding 30 4.1.2 Label Encoding 31 4.1.3 Count,and Percentage Encod
5、ing 32 4.1.4 Encoding by Rank of Counts 33 4.1.5 Target Encoding 33 4.2 Engineering Ordinal Features 34 4.2.1 Rank Encoding 35 4.2.2 Polynomial Encoding 35 4.2.3 Backward Difference Encoding 36 4.3 Engineering Numerical Features 36 4.3.1 Binning 37 4.3.2 Square and Cube 37 4.3.3 Regression Splines 3
6、7 4.3.4 Square Root and Cube Root 38 4.3.5 Log Transformation 39 4.3.6 Standardization and Normalization 40 4.3.7 Box-cox Transformation 40 4.3.8 Yeo-Johnson Transformation 40 4.4 Conclusion 41 Chapter 5:Interaction Effect Feature Engineering 43 5.1 Interaction Plot 43 5.2 SHAP 47 5.2.1 Car Sales 48