Book description
Create end-to-end, reproducible feature engineering pipelines that can be deployed into production using open-source Python libraries
Key Features
- Learn and implement feature engineering best practices
- Reinforce your learning with the help of multiple hands-on recipes
- Build end-to-end feature engineering pipelines that are performant and reproducible
Book Description
Feature engineering, the process of transforming variables and creating features, albeit time-consuming, ensures that your machine learning models perform seamlessly. This second edition of Python Feature Engineering Cookbook will take the struggle out of feature engineering by showing you how to use open source Python libraries to accelerate the process via a plethora of practical, hands-on recipes.
This updated edition begins by addressing fundamental data challenges such as missing data and categorical values, before moving on to strategies for dealing with skewed distributions and outliers. The concluding chapters show you how to develop new features from various types of data, including text, time series, and relational databases. With the help of numerous open source Python libraries, you'll learn how to implement each feature engineering method in a performant, reproducible, and elegant manner.
By the end of this Python book, you will have the tools and expertise needed to confidently build end-to-end and reproducible feature engineering pipelines that can be deployed into production.
What you will learn
- Impute missing data using various univariate and multivariate methods
- Encode categorical variables with one-hot, ordinal, and count encoding
- Handle highly cardinal categorical variables
- Transform, discretize, and scale your variables
- Create variables from date and time with pandas and Feature-engine
- Combine variables into new features
- Extract features from text as well as from transactional data with Featuretools
- Create features from time series data with tsfresh
Who this book is for
This book is for machine learning and data science students and professionals, as well as software engineers working on machine learning model deployment, who want to learn more about how to transform their data and create new features to train machine learning models in a better way.
Table of contents
- Python Feature Engineering Cookbook
- Contributors
- About the author
- About the reviewers
- Preface
-
Chapter 1: Imputing Missing Data
- Technical requirements
- Removing observations with missing data
- Performing mean or median imputation
- Imputing categorical variables
- Replacing missing values with an arbitrary number
- Finding extreme values for imputation
- Marking imputed values
- Performing multivariate imputation by chained equations
- Estimating missing data with nearest neighbors
-
Chapter 2: Encoding Categorical Variables
- Technical requirements
- Creating binary variables through one-hot encoding
- Performing one-hot encoding of frequent categories
- Replacing categories with counts or the frequency of observations
- Replacing categories with ordinal numbers
- Performing ordinal encoding based on the target value
- Implementing target mean encoding
- Encoding with the Weight of Evidence
- Grouping rare or infrequent categories
- Performing binary encoding
- Chapter 3: Transforming Numerical Variables
- Chapter 4: Performing Variable Discretization
- Chapter 5: Working with Outliers
- Chapter 6: Extracting Features from Date and Time Variables
- Chapter 7: Performing Feature Scaling
- Chapter 8: Creating New Features
- Chapter 9: Extracting Features from Relational Data with Featuretools
- Chapter 10: Creating Features from a Time Series with tsfresh
- Chapter 11: Extracting Features from Text Variables
- Index
- Other Books You May Enjoy
Product information
- Title: Python Feature Engineering Cookbook - Second Edition
- Author(s):
- Release date: October 2022
- Publisher(s): Packt Publishing
- ISBN: 9781804611302
You might also like
book
Python Feature Engineering Cookbook
Extract accurate information from data to train and improve machine learning models using NumPy, SciPy, pandas, …
book
Modern Python Cookbook - Second Edition
Complete recipes spread across 15 chapters to help you overcome commonly faced issues by Python for …
book
Machine Learning with Python Cookbook, 2nd Edition
This practical guide provides more than 200 self-contained recipes to help you solve machine learning challenges …
book
Advanced Python Programming - Second Edition
Write fast, robust, and highly reusable applications using Python's internal optimization, state-of-the-art performance-benchmarking tools, and cutting-edge …