This is the code repository for Python Feature Engineering Cookbook-Second Edition, published by Packt.
Over 70 recipes for creating, engineering, and transforming features to build machine learning models
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.
This book covers the following exciting features:
- 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
If you feel this book is for you, get your copy today!
All of the code is organized into folders.
The code will look like the following:
X_train = pd.DataFrame(
X_train,
columns=numeric_vars + remaining_vars,
)
Following is what you need for this book: 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.
With the following software and hardware list you can run all code files present in the book (Chapter 1-11).
Chapter | Software required | OS required |
---|---|---|
1-11 | Python 3.3 or greater | Windows, Mac OS, or Linux |
1-11 | Jupyter Notebook | Windows, Mac OS, or Linux |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
Soledad Galli is a data scientist, instructor, and software developer with more than 10 years of experience in world-class academic institutions and renowned businesses. She has developed and put into production machine learning models to assess insurance claims and credit risk and prevent fraud. She teaches multiple online courses on machine learning, which have enrolled 44,000+ students worldwide and consistently receive good student reviews. She is also the developer and maintainer of the open source Python library Feature-engine, which is currently downloaded 100,000+ times per month. Soledad received a Data Science Leaders Award in 2018 and was recognized as one of LinkedIn's voices in data science and analytics in 2019.