Featuretools

1.31.0 · active · verified Thu Apr 16

Featuretools is an open-source Python library for automated feature engineering. It excels at transforming temporal and relational datasets into feature matrices suitable for machine learning. The library, currently at version 1.31.0, is actively maintained by Alteryx and follows a frequent release cadence, often introducing new features and improvements.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to load a multi-table dataset into an EntitySet, define a target dataframe, and then use Deep Feature Synthesis (DFS) to automatically generate a rich set of features. It utilizes built-in aggregation and transform primitives to create new meaningful features for a machine learning task.

import featuretools as ft
import pandas as pd

# Load mock customer data into an EntitySet
es = ft.demo.load_mock_customer(return_entityset=True)

# Define target dataframe for feature engineering
target_dataframe_name = "customers"

# Run Deep Feature Synthesis (DFS)
feature_matrix, feature_defs = ft.dfs(
    entityset=es,
    target_dataframe_name=target_dataframe_name,
    agg_primitives=["count", "sum", "mean"],
    trans_primitives=["day", "month", "weekday"]
)

print(feature_matrix.head())

view raw JSON →