Combining numerical features
In Chapter 8, Creating New Features, we saw that we can create new features by combining variables with mathematical operations. Featuretools supports a number of operations to combine variables, including addition, division, modulo, and multiplication. In this recipe, we will learn how to combine these features with Featuretools.
How to do it...
Let’s begin by importing the libraries and getting the dataset ready:
- First, we’ll import
pandas
,featuretools
, and theCategorical
logical type:import pandas as pd import featuretools as ft from woodwork.logical_types import Categorical
- Let’s load the dataset that we prepared in the Technical requirements section:
df = pd.read_csv( "retail.csv", parse_dates=["invoice_date"])
- Let’s set up an entity set:
es = ft.EntitySet(id="data")
- Let’s add the dataframe to the entity set:
es = es.add_dataframe( ...