Book Image

Python Feature Engineering Cookbook - Second Edition

By : Soledad Galli
Book Image

Python Feature Engineering Cookbook - Second Edition

By: Soledad Galli

Overview of this book

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.
Table of Contents (14 chapters)

To get the most out of this book

Python Feature Engineering Cookbook will give you the practice, tools, and techniques to streamline your feature engineering pipelines and simplify and improve the quality of your code. The book discusses feature engineering methods to transform and create features to train machine learning models using Python. Therefore, some knowledge of machine learning and Python programming will be an asset.

The recipes have been tested in the following library versions: category-encoders == 2.4.0, Feature-engine == 1.4.0, featuretools == 1.4.0, 1.5.0, matplotlib==3.4.2, numpy==1.22.0, pandas==1.5.0, scikit-learn==1.1.0, scipy==1.7.0, seaborn==0.11.1, statsmodels==0.12.2, and tsfresh==0.19.0.

Software/hardware covered in the book

OS requirements

Python 3.3 or greater

Windows, macOS, or Linux

Jupyter Notebook

Windows, macOS, or Linux

Note that earlier versions or newer versions than those displayed in the table may prevent code from running. If you are using newer versions, make sure to check their documentation online for changes in parameter names. That usually solves the issue.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Python-Feature-Engineering-Cookbook-Second-Edition. If there’s an update to the code, it will be updated in the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!