### Load Mock Customer Data Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Load a multi-table dataset with timestamped customer transactions for the quick start example. ```python data = ft.demo.load_mock_customer() ``` -------------------------------- ### Install Featuretools from Source Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Clones the Featuretools repository from GitHub and installs the package with pip. ```bash git clone https://github.com/alteryx/featuretools.git cd featuretools python -m pip install . ``` -------------------------------- ### Install Premium Primitives Add-on via PyPI Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the Premium Primitives add-on to use primitives from Premium Primitives. ```console $ python -m pip install "featuretools[premium]" ``` -------------------------------- ### Install All Featuretools Add-ons via PyPI Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs all optional add-ons (NLP Primitives, Premium Primitives, Dask) at once using the 'complete' extra. ```console $ python -m pip install "featuretools[complete]" ``` -------------------------------- ### Install All Add-ons via Conda Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs all optional add-ons (NLP Primitives, Dask) at once using conda-forge. ```console $ conda install -c conda-forge nlp-primitives dask distributed ``` -------------------------------- ### Install NLP Primitives Add-on via PyPI Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the NLP Primitives add-on for Natural Language Processing primitives. ```console $ python -m pip install "featuretools[nlp]" ``` -------------------------------- ### Install all Featuretools add-ons Source: https://github.com/alteryx/featuretools/blob/main/README.md Install all optional add-ons at once using the 'complete' extra. ```bash python -m pip install "featuretools[complete]" ``` -------------------------------- ### Install Dask Add-on via PyPI Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the Dask add-on to run calculate_feature_matrix in parallel with n_jobs. ```console $ python -m pip install "featuretools[dask]" ``` -------------------------------- ### Install Premium Primitives add-on Source: https://github.com/alteryx/featuretools/blob/main/README.md Install the premium-primitives repo to use Premium Primitives. ```bash python -m pip install "featuretools[premium]" ``` -------------------------------- ### Install NLP Primitives Add-on via Conda Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the NLP Primitives add-on using conda-forge. ```console $ conda install -c conda-forge nlp-primitives ``` -------------------------------- ### Install GraphViz and Pandoc on Ubuntu Source: https://github.com/alteryx/featuretools/blob/main/contributing.md Install required dependencies for running all unit tests and building docs locally. Use apt on Ubuntu. ```console sudo apt install graphviz pandoc -y ``` -------------------------------- ### Install Graphviz on Ubuntu with pip Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs Graphviz via apt and the Python graphviz package via pip. Required for EntitySet.plot or featuretools.graph_feature. ```console $ sudo apt install graphviz $ python -m pip install graphviz ``` -------------------------------- ### Install GraphViz and Pandoc on macOS (Intel) Source: https://github.com/alteryx/featuretools/blob/main/contributing.md Install required dependencies for running all unit tests and building docs locally. Use Homebrew on macOS Intel. ```console brew install graphviz pandoc ``` -------------------------------- ### Install Featuretools with PyPI Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the latest Featuretools version from PyPI using pip. Requires Python 3.9 - 3.12. ```console $ python -m pip install featuretools ``` -------------------------------- ### Import Featuretools Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Import the Featuretools library to begin using automated feature engineering. ```python import featuretools as ft ``` -------------------------------- ### Install Featuretools with Conda Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs Featuretools from the conda-forge channel. Requires Conda to be installed. ```console $ conda install -c conda-forge featuretools ``` -------------------------------- ### Install Graphviz on Windows with pip Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the Python graphviz package via pip. After installation, graphviz.exe must be installed separately from the official source. ```console $ python -m pip install graphviz ``` -------------------------------- ### Import pandas and set display options Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/handling_time.ipynb Sets up pandas for displaying the example dataframes with up to 200 columns. ```python import pandas as pd pd.options.display.max_columns = 200 ``` -------------------------------- ### Install NLP Primitives add-on Source: https://github.com/alteryx/featuretools/blob/main/README.md Install the nlp-primitives repo to use Natural Language Primitives. ```bash python -m pip install "featuretools[nlp]" ``` -------------------------------- ### Install Dask Add-on via Conda Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the Dask add-on using conda-forge. ```console $ conda install -c conda-forge dask distributed ``` -------------------------------- ### Create virtual environment and install Featuretools in editable mode Source: https://github.com/alteryx/featuretools/blob/main/contributing.md Set up a separate Python virtual environment and install Featuretools in editable mode. Use this to avoid affecting your existing environment. ```bash python -m venv venv source venv/bin/activate make installdeps git checkout -b issue####-branch_name ``` -------------------------------- ### Install Featuretools with pip Source: https://github.com/alteryx/featuretools/blob/main/README.md Install the core Featuretools package using pip. ```bash python -m pip install featuretools ``` -------------------------------- ### Dockerfile for Featuretools Image Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Creates a Docker image with Featuretools pre-installed on Python 3.9-slim-buster. ```dockerfile FROM --platform=linux/x86_64 python:3.9-slim-buster RUN apt update && apt -y update RUN apt install -y build-essential RUN pip3 install --upgrade --quiet pip RUN pip3 install featuretools ``` -------------------------------- ### Install Dask Support add-on Source: https://github.com/alteryx/featuretools/blob/main/README.md Install Dask support to run DFS with njobs > 1. ```bash python -m pip install "featuretools[dask]" ``` -------------------------------- ### Create sample dataframes Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Creates two small pandas DataFrames (orders_df and items_df) used in the examples. ```python orders_df = pd.DataFrame( {"order_id": [0, 1, 2], "order_date": ["2021-01-02", "2021-01-03", "2021-01-04"]} ) items_df = pd.DataFrame( { "id": [0, 1, 2, 3, 4], "order_id": [0, 1, 1, 2, 2], "item_price": [29.95, 4.99, 10.25, 20.50, 15.99], "on_sale": [False, True, False, True, False], } ) ``` -------------------------------- ### Run DFS for Customers Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Generate a feature matrix for the customers target DataFrame using Deep Feature Synthesis. ```python feature_matrix_customers, features_defs = ft.dfs( dataframes=dataframes, relationships=relationships, target_dataframe_name="customers", ) feature_matrix_customers ``` -------------------------------- ### Install Graphviz on Windows with conda Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs the python-graphviz package via conda-forge. Required for EntitySet.plot or featuretools.graph_feature. ```console $ conda install -c conda-forge python-graphviz ``` -------------------------------- ### Install Graphviz on Ubuntu with conda Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs Graphviz via apt and the python-graphviz package via conda-forge. Required for EntitySet.plot or featuretools.graph_feature. ```console $ sudo apt install graphviz $ conda install -c conda-forge python-graphviz ``` -------------------------------- ### Access Customers DataFrame Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Retrieve the customers DataFrame from the loaded mock data. ```python customers_df = data["customers"] customers_df ``` -------------------------------- ### Run DFS for Sessions Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Generate a feature matrix for the sessions target DataFrame and display the first 5 rows. ```python feature_matrix_sessions, features_defs = ft.dfs( dataframes=dataframes, relationships=relationships, target_dataframe_name="sessions" ) feature_matrix_sessions.head(5) ``` -------------------------------- ### Install Graphviz on macOS with pip Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs Graphviz via Homebrew and the Python graphviz package via pip. Required for EntitySet.plot or featuretools.graph_feature. ```console $ brew install graphviz $ python -m pip install graphviz ``` -------------------------------- ### Import pandas and featuretools Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Imports the pandas and featuretools libraries needed for the examples. ```python import pandas as pd import featuretools as ft ``` -------------------------------- ### Access Sessions DataFrame Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Retrieve the sessions DataFrame and sample 5 rows. ```python sessions_df = data["sessions"] sessions_df.sample(5) ``` -------------------------------- ### Graph Feature Lineage Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Visualize the feature lineage graph for a specific feature. ```python ft.graph_feature(feature) ``` -------------------------------- ### Copy DataFrames for Sessions Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Create copies of the DataFrames to prepare for building features for sessions. ```python dataframes = { "customers": (customers_df.copy(), "customer_id"), "sessions": (sessions_df.copy(), "session_id", "session_start"), "transactions": (transactions_df.copy(), "transaction_id", "transaction_time"), } ``` -------------------------------- ### Install Featuretools with Conda Source: https://github.com/alteryx/featuretools/blob/main/README.md Install Featuretools from the Conda-forge channel. ```bash conda install -c conda-forge featuretools ``` -------------------------------- ### Install Graphviz on macOS with conda Source: https://github.com/alteryx/featuretools/blob/main/docs/source/install.md Installs Graphviz via Homebrew and the python-graphviz package via conda-forge. Required for EntitySet.plot or featuretools.graph_feature. ```console $ brew install graphviz $ conda install -c conda-forge python-graphviz ``` -------------------------------- ### Set up urllib opener for testing Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/handling_time.ipynb Configures a urllib opener with a custom header for testing purposes. This is a prerequisite for loading the flight dataset in the following example. ```python import urllib.request as urllib2 opener = urllib2.build_opener() opener.addheaders = [("Testing", "True")] urllib2.install_opener(opener) ``` -------------------------------- ### Access Transactions DataFrame Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Retrieve the transactions DataFrame and sample 5 rows. ```python transactions_df = data["transactions"] transactions_df.sample(5) ``` -------------------------------- ### Clean up temporary files Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Removes the temporary files 'feature_definitions.json' and 'feature_matrix.csv' created during the deployment example. ```python import os os.remove("feature_definitions.json") os.remove("feature_matrix.csv") ``` -------------------------------- ### Create users dataframe for type inference example Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Creates a pandas DataFrame with user data used to demonstrate Woodwork logical type inference in Featuretools 1.0. ```python users_df = pd.DataFrame( {"id": [0, 1, 2], "name": ["John Doe", "Rita Book", "Teri Dactyl"]} ) ``` -------------------------------- ### Access a Specific Feature Definition Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Retrieve the feature definition at index 18 from the generated features. ```python feature = features_defs[18] feature ``` -------------------------------- ### CumSum transform primitive example Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Shows the CumSum primitive calculating a running sum on a list. ```python from featuretools.primitives import CumSum cum_sum = CumSum() cum_sum([1, 2, 3, 4, 5]).tolist() ``` -------------------------------- ### Define Relationships List Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Specify relationships between parent and child DataFrames for DFS. ```python relationships = [ ("sessions", "session_id", "transactions", "session_id"), ("customers", "customer_id", "sessions", "customer_id"), ] ``` -------------------------------- ### Install featuretools_sql with pip Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/sql_database_integration.ipynb Install the featuretools_sql add-on library using pip. The package is included in the 'sql' extra of featuretools. ```bash python -m pip install "featuretools[sql]" ``` -------------------------------- ### Load mock customer data for training and test entity sets Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Creates training and test entity sets using the mock customer dataset. A random seed is used to generate different data for the test set. ```python import featuretools as ft es_train = ft.demo.load_mock_customer(return_entityset=True) es_test = ft.demo.load_mock_customer(return_entityset=True, random_seed=33) ``` -------------------------------- ### Load mock customer data and create EntitySet with single DataFrame Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Loads the mock customer dataset and merges transactions, sessions, and customers into a single DataFrame, then creates an EntitySet with only one DataFrame. This setup prevents DFS from creating aggregation features because aggregation requires at least two DataFrames. ```python data = ft.demo.load_mock_customer() transactions_df = data["transactions"].merge(data["sessions"]).merge(data["customers"]) es = ft.EntitySet(id="customer_data") es = es.add_dataframe( dataframe_name="transactions", dataframe=transactions_df, index="transaction_id" ) es ``` -------------------------------- ### Load flight entity set and import selection functions Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/feature_selection.ipynb Sets up the entity set used for feature selection examples. Imports the three selection functions and loads the flight demo data with 50 rows. ```python import pandas as pd import featuretools as ft from featuretools.demo.flight import load_flight from featuretools.selection import ( remove_highly_correlated_features, remove_highly_null_features, remove_single_value_features, ) es = load_flight(nrows=50) es ``` -------------------------------- ### Import libraries for custom primitives Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/advanced_custom_primitives.ipynb Imports required libraries including featuretools, woodwork, and testing utilities for creating custom primitives. ```python import re import numpy as np from woodwork.column_schema import ColumnSchema from woodwork.logical_types import Datetime, NaturalLanguage import featuretools as ft from featuretools.primitives import TransformPrimitive from featuretools.tests.testing_utils import make_ecommerce_entityset ``` -------------------------------- ### Create Sum feature and cutoff time for training window example Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/handling_time.ipynb Builds a Sum feature over transaction amounts for sessions and defines a cutoff time at 2014-01-01 00:04:20 for session 1. Used with a 65-second training window to test include_cutoff_time behavior. ```python from featuretools.primitives import Sum sum_log = ft.Feature( es["transactions"].ww["amount"], parent_dataframe_name="sessions", primitive=Sum, ) cutoff_time = pd.DataFrame( { "session_id": [1], "time": ["2014-01-01 00:04:20"], } ).astype({"time": "datetime64[ns]"}) ``` -------------------------------- ### Build documentation locally Source: https://github.com/alteryx/featuretools/blob/main/contributing.md Build the documentation locally after making changes to docs. Then view the built HTML in your browser. ```bash # go to docs and build cd docs make html # view docs locally open build/html/index.html ``` -------------------------------- ### Preview order_products DataFrame Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Displays the first few rows of the 'order_products' DataFrame from the retail EntitySet. ```python order_products_df = es["order_products"] order_products_df.head() ``` -------------------------------- ### Get ColumnSchema from product_id column Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Retrieves the Woodwork ColumnSchema for the 'product_id' column in the 'products' DataFrame of the retail EntitySet. The resulting ColumnSchema is a type definition for that column. ```python products_df = es["products"] product_ids_series = products_df.ww["product_id"] column_schema = product_ids_series.ww.schema column_schema ``` -------------------------------- ### View slice of transactions data for session 1 Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/handling_time.ipynb Selects the first rows of the 'transactions' dataframe for session_id 1 to inspect the data used in the cutoff time examples. ```python df = es["transactions"] df[df["session_id"] == 1].head() ``` -------------------------------- ### Calculate feature matrix for new data Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Computes the feature matrix for the test entity set using the loaded features, producing the same features as before but based on test data. ```python feature_matrix = ft.calculate_feature_matrix(saved_features, es_test) feature_matrix ``` -------------------------------- ### Load demo retail EntitySet Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Loads the demo retail EntitySet using ft.demo.load_retail() and displays it. This EntitySet contains Woodwork typing information stored in its DataFrames. ```python es = ft.demo.load_retail() es ``` -------------------------------- ### Load saved features with ft.load_features Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Reads the saved feature definitions from the JSON file back into a list for calculating features on new data. ```python saved_features = ft.load_features("feature_definitions.json") ``` -------------------------------- ### Read feature matrix back from CSV Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Reads the saved CSV file back into a pandas DataFrame, using 'customer_id' as the index column. ```python import pandas as pd saved_fm = pd.read_csv("feature_matrix.csv", index_col="customer_id") saved_fm ``` -------------------------------- ### Build EntitySet with transactions and products Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Creates an EntitySet from mock customer data, merging transactions, sessions, and customers, then adding a relationship between products and transactions. ```python data = ft.demo.load_mock_customer() transactions_df = data["transactions"].merge(data["sessions"]).merge(data["customers"]) products_df = data["products"] es = ft.EntitySet(id="customer_data") es = es.add_dataframe( dataframe_name="transactions", dataframe=transactions_df, index="transaction_id", time_index="transaction_time", ) es = es.add_dataframe( dataframe_name="products", dataframe=products_df, index="product_id" ) es = es.add_relationship("products", "product_id", "transactions", "product_id") ``` -------------------------------- ### Build and encode feature definitions with DFS Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Uses deep feature synthesis (DFS) to create feature definitions from the training entity set, then applies one-hot encoding based on training data values. ```python feature_matrix, feature_defs = ft.dfs( entityset=es_train, target_dataframe_name="customers" ) feature_matrix_enc, features_enc = ft.encode_features(feature_matrix, feature_defs) feature_matrix_enc ``` -------------------------------- ### Define primitive input and return types with old Variable classes Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb In earlier Featuretools versions, primitive input and return types were defined by specifying the appropriate Variable class. This example shows the old way for the Age transform primitive. ```python input_types = [DateOfBirth] return_type = Numeric ``` -------------------------------- ### Load mock customer EntitySet Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Loads the mock customer EntitySet and displays it in a notebook. ```python es = ft.demo.load_mock_customer(return_entityset=True) es ``` -------------------------------- ### List Semantic Tags with ft.list_semantic_tags() Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Use this to see semantic tags defined within Woodwork. These tags inform how Featuretools interprets data; for example, the Age primitive requires the 'date_of_birth' tag, which must be manually added. ```python ft.list_semantic_tags() ``` -------------------------------- ### Define DataFrames Dictionary Source: https://github.com/alteryx/featuretools/blob/main/docs/source/index.ipynb Specify a dictionary of DataFrames with their index and time index columns for DFS. ```python dataframes = { "customers": (customers_df, "customer_id"), "sessions": (sessions_df, "session_id", "session_start"), "transactions": (transactions_df, "transaction_id", "transaction_time"), } ``` -------------------------------- ### Run pre-commit linting hooks Source: https://github.com/alteryx/featuretools/blob/main/contributing.md Run linting hooks manually before committing. Use --all-files to run on all files, otherwise only changed files are checked. ```bash # run linting hooks only on changed files pre-commit run # run linting hooks on all files pre-commit run --all-files ``` -------------------------------- ### Run DFS with training_window after setting last_time_index Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Creates cutoff times with customer_id, time, and label columns, then runs ft.dfs with a 1-hour training window and cutoff_time_in_index=True. Requires the entityset from the previous snippet with last_time_indexes added. ```python cutoff_times = pd.DataFrame() cutoff_times["customer_id"] = [1, 2, 3, 1] cutoff_times["time"] = pd.to_datetime( ["2014-1-1 04:00", "2014-1-1 05:00", "2014-1-1 06:00", "2014-1-1 08:00"] ) cutoff_times["label"] = [True, True, False, True] feature_matrix, feature_defs = ft.dfs( entityset=es, target_dataframe_name="customers", cutoff_time=cutoff_times, cutoff_time_in_index=True, training_window="1 hour", ) ``` -------------------------------- ### Build EntitySet and plot before normalization Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Creates an EntitySet with transactions and products, then plots it to inspect semantic tags. ```python data = ft.demo.load_mock_customer() transactions_df = data["transactions"].merge(data["sessions"]).merge(data["customers"]) products_df = data["products"] es = ft.EntitySet(id="customer_data") es = es.add_dataframe( dataframe_name="transactions", dataframe=transactions_df, index="transaction_id", time_index="transaction_time", ) es.plot() ``` -------------------------------- ### Run linting and tests before submitting Source: https://github.com/alteryx/featuretools/blob/main/contributing.md Verify tests run and code lints properly before submitting your pull request. Includes commands for linting, auto-fixing common issues, and running tests. ```bash # runs linting make lint # will fix some common linting issues automatically make lint-fix # runs test make test ``` -------------------------------- ### Create simple EntitySet for primitive comparison Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Creates a simple EntitySet with a normalized dataframe to demonstrate primitive types. ```python import pandas as pd import featuretools as ft df = pd.DataFrame( { "id": [1, 2, 3, 4, 5, 6], "time_index": pd.date_range("1/1/2019", periods=6, freq="D"), "group": ["a", "a", "a", "a", "a", "a"], "val": [5, 1, 10, 20, 6, 23], } ) es = ft.EntitySet() es = es.add_dataframe( dataframe_name="observations", dataframe=df, index="id", time_index="time_index" ) es = es.normalize_dataframe( base_dataframe_name="observations", new_dataframe_name="groups", index="group" ) es.plot() ``` -------------------------------- ### Fork and clone Featuretools repository Source: https://github.com/alteryx/featuretools/blob/main/contributing.md Clone your fork and connect it to the upstream Featuretools repo. Run these commands after forking the project on GitHub. ```bash git clone https://github.com/your-user-name/featuretools.git cd featuretools git remote add upstream https://github.com/alteryx/featuretools ``` -------------------------------- ### Create Dataframes for combining interesting values Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Load mock customer data and merge transactions, sessions, and customers dataframes. Also load products dataframe. ```python data = ft.demo.load_mock_customer() transactions_df = data["transactions"].merge(data["sessions"]).merge(data["customers"]) products_df = data["products"] ``` ```python transactions_df.head() ``` ```python products_df.head() ``` -------------------------------- ### Select products DataFrame from EntitySet Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Selects the 'products' DataFrame from the EntitySet and displays its first few rows with df.head(). ```python df = es["products"] df.head() ``` -------------------------------- ### Create training EntitySet and run DFS Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Builds a training EntitySet with a categorical column and runs deep feature synthesis to generate a feature matrix and feature definitions. ```python train_data = pd.DataFrame( { "customer_id": [1, 2, 3, 4, 5], "product_purchased": ["coke zero", "car", "toothpaste", "coke zero", "car"], } ) es_train = ft.EntitySet(id="customer_data") es_train = es_train.add_dataframe( dataframe_name="customers", dataframe=train_data, index="customer_id", logical_types={"product_purchased": ww.logical_types.Categorical}, ) feature_matrix_train, features = ft.dfs( entityset=es_train, target_dataframe_name="customers" ) feature_matrix_train ``` -------------------------------- ### Display products dataframe Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/using_entitysets.ipynb Shows the products dataframe from the mock customer dataset. ```python products_df = data["products"] products_df ``` -------------------------------- ### Load mock customer entity set Source: https://github.com/alteryx/featuretools/blob/main/README.md Load a multi-table dataset of timestamped customer transactions and plot the entity set. ```python >> import featuretools as ft >> es = ft.demo.load_mock_customer(return_entityset=True) >> es.plot() ``` -------------------------------- ### Access single column typing info Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Shows how to get the Woodwork.ColumnSchema for a single column from the columns dictionary. ```python es["items"].ww.columns["item_price"] ``` -------------------------------- ### get_recommended_primitives Source: https://github.com/alteryx/featuretools/blob/main/docs/source/api_reference.rst Gets recommended primitives. This function returns a list of recommended primitives for a given task. ```APIDOC ## get_recommended_primitives ### Description Gets recommended primitives. This function returns a list of recommended primitives for a given task. ### Method get_recommended_primitives ### Endpoint get_recommended_primitives ``` -------------------------------- ### Load flight EntitySet and inspect trip_logs Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/handling_time.ipynb Loads the flight demo data with 100 rows and displays the EntitySet and the first three rows of the trip_logs dataframe. ```python es_flight = ft.demo.load_flight(nrows=100) es_flight es_flight["trip_logs"].head(3) ``` -------------------------------- ### EntitySet.get_backward_dataframes Source: https://github.com/alteryx/featuretools/blob/main/docs/source/api_reference.rst Gets backward dataframes from the EntitySet. This method returns dataframes that are ancestors of a given dataframe. ```APIDOC ## EntitySet.get_backward_dataframes ### Description Gets backward dataframes from the EntitySet. This method returns dataframes that are ancestors of a given dataframe. ### Method get_backward_dataframes ### Endpoint EntitySet.get_backward_dataframes ``` -------------------------------- ### EntitySet.get_forward_dataframes Source: https://github.com/alteryx/featuretools/blob/main/docs/source/api_reference.rst Gets forward dataframes from the EntitySet. This method returns dataframes that are descendants of a given dataframe. ```APIDOC ## EntitySet.get_forward_dataframes ### Description Gets forward dataframes from the EntitySet. This method returns dataframes that are descendants of a given dataframe. ### Method get_forward_dataframes ### Endpoint EntitySet.get_forward_dataframes ``` -------------------------------- ### Load mock customer EntitySet and check time_index Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Loads the mock customer EntitySet and prints the time_index column of the customers dataframe. This is a prerequisite for using the training_window parameter in ft.dfs. ```python es = ft.demo.load_mock_customer(return_entityset=True) es["customers"].ww.time_index ``` -------------------------------- ### IsYearStart Source: https://github.com/alteryx/featuretools/blob/main/docs/source/api_reference.rst Transform primitive that checks if a date is the start of the year. This is part of the datetime transform primitives in featuretools. ```APIDOC ## IsYearStart ### Description Transform primitive that checks if a date is the start of the year. ### Method Class definition ### Endpoint featuretools.primitives.IsYearStart ``` -------------------------------- ### IsQuarterStart Source: https://github.com/alteryx/featuretools/blob/main/docs/source/api_reference.rst Transform primitive that checks if a date is the start of the quarter. This is part of the datetime transform primitives in featuretools. ```APIDOC ## IsQuarterStart ### Description Transform primitive that checks if a date is the start of the quarter. ### Method Class definition ### Endpoint featuretools.primitives.IsQuarterStart ``` -------------------------------- ### Initialize Woodwork on items_df Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Initializes Woodwork on items_df, setting the dataframe name and index. ```python items_df.ww.init(name="items", index="id") items_df.ww ``` -------------------------------- ### Create EntitySet and run DFS with cutoff times Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Build an EntitySet from the train data, define cutoff times, and run DFS to generate a feature matrix. Using cutoff_time and cutoff_time_in_index=True prevents label leakage. ```python es_train_data = ft.EntitySet(id="customer_data") es_train_data = es_train_data.add_dataframe( dataframe_name="customers", dataframe=train_data, index="customer_id" ) cutoff_times = pd.DataFrame( { "customer_id": [1, 2, 3, 4, 5], "time": pd.date_range("2014-01-01 01:41:50", periods=5, freq="25min"), } ) feature_matrix_train, features = ft.dfs( entityset=es_train_data, target_dataframe_name="customers", cutoff_time=cutoff_times, cutoff_time_in_index=True, ) feature_matrix_train.head() ``` -------------------------------- ### IsMonthStart Source: https://github.com/alteryx/featuretools/blob/main/docs/source/api_reference.rst Transform primitive that checks if a date is the start of the month. This is part of the datetime transform primitives in featuretools. ```APIDOC ## IsMonthStart ### Description Transform primitive that checks if a date is the start of the month. ### Method Class definition ### Endpoint featuretools.primitives.IsMonthStart ``` -------------------------------- ### Load mock customer entity set Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/handling_time.ipynb Loads the mock customer entity set with a fixed random seed and displays the first rows of the transactions dataframe. ```python import featuretools as ft es = ft.demo.load_mock_customer(return_entityset=True, random_seed=0) es["transactions"].head() ``` -------------------------------- ### EntitySet.__getitem__ Source: https://github.com/alteryx/featuretools/blob/main/docs/source/api_reference.rst Gets a dataframe from the EntitySet by name. This method allows access to dataframes using square brackets. ```APIDOC ## EntitySet.__getitem__ ### Description Gets a dataframe from the EntitySet by name. This method allows access to dataframes using square brackets. ### Method __getitem__ ### Endpoint EntitySet.__getitem__ ``` -------------------------------- ### Get ColumnSchema from quantity column Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Retrieves the Woodwork ColumnSchema for the 'quantity' column in the 'order_products' DataFrame. This ColumnSchema is a type definition for that column. ```python quantity_series = order_products_df.ww["quantity"] column_schema = quantity_series.ww.schema column_schema ``` -------------------------------- ### Replace dataframe with EntitySet.replace_dataframe (1.0) Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb In Featuretools 1.0, use EntitySet.replace_dataframe to replace the data for a dataframe. The example also displays the resulting EntitySet. ```python new_users_df = pd.DataFrame({"id": [0, 1], "name": ["Anne Teak", "Art Decco"]}) es.replace_dataframe(dataframe_name="users", df=new_users_df) es["users"] ``` -------------------------------- ### Save feature matrix to CSV Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Exports the feature matrix (a pandas DataFrame) to a CSV file named 'feature_matrix.csv'. ```python feature_matrix.to_csv("feature_matrix.csv") ``` -------------------------------- ### Reset relationships (hidden setup) Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb This hidden cell resets the relationships list so the relationship can be added again. It is part of the docs build and not shown to users. ```python # Reset the relationship so we can add it again # NOTE: This cell is hidden in the docs build es.relationships = [] ``` -------------------------------- ### Create EntitySet with normalized dataframes Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Build an EntitySet with transactions and products dataframes, then normalize to sessions and customers dataframes. The transactions dataframe includes the new product_id_device column with categorical logical type. ```python es = ft.EntitySet(id="customer_data") es = es.add_dataframe( dataframe_name="transactions", dataframe=transactions_df, index="transaction_id", time_index="transaction_time", logical_types={ "product_id": ww.logical_types.Categorical, "product_id_device": ww.logical_types.Categorical, "zip_code": ww.logical_types.PostalCode, }, ) es = es.add_dataframe( dataframe_name="products", dataframe=products_df, index="product_id" ) es = es.normalize_dataframe( base_dataframe_name="transactions", new_dataframe_name="sessions", index="session_id", additional_columns=["device", "product_id_device", "customer_id"], ) es = es.normalize_dataframe( base_dataframe_name="sessions", new_dataframe_name="customers", index="customer_id" ) es ``` -------------------------------- ### Check Featuretools version Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Prints the installed Featuretools version to verify it is greater than 0.4.1 after upgrading on Google Colab. ```python import featuretools as ft print(ft.__version__) ``` -------------------------------- ### Save features to JSON with ft.save_features Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/deployment.ipynb Saves the list of encoded features to a JSON file named 'feature_definitions.json' for later use. ```python ft.save_features(features_enc, "feature_definitions.json") ``` -------------------------------- ### Load mock customer EntitySet Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/afe.ipynb Loads the mock customer dataset as an EntitySet using featuretools.demo.load_mock_customer. This is the required input for running DFS. ```python import featuretools as ft es = ft.demo.load_mock_customer(return_entityset=True) es ``` -------------------------------- ### Create test EntitySet and calculate feature matrix Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Builds a test EntitySet with categorical values not seen in training (e.g., 'water') and missing a training value ('toothpaste'), then calculates the feature matrix using the encoded features. ```python test_data = pd.DataFrame( { "customer_id": [6, 7, 8, 9, 10], "product_purchased": ["coke zero", "car", "coke zero", "coke zero", "water"], } ) es_test = ft.EntitySet(id="customer_data") es_test = es_test.add_dataframe( dataframe_name="customers", dataframe=test_data, index="customer_id" ) feature_matrix_test = ft.calculate_feature_matrix( entityset=es_test, features=features_encoded ) feature_matrix_test.head() ``` -------------------------------- ### Load mock entityset and run DFS to create features Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/feature_descriptions.ipynb Loads the mock customer entityset and runs deep feature synthesis (DFS) with specified aggregation and transform primitives to generate feature definitions for the 'customers' target dataframe. ```python import featuretools as ft es = ft.demo.load_mock_customer(return_entityset=True) feature_defs = ft.dfs( entityset=es, target_dataframe_name="customers", agg_primitives=["mean", "sum", "mode", "n_most_common"], trans_primitives=["month", "hour"], max_depth=2, features_only=True, ) ``` -------------------------------- ### Get unique interesting values from combined column Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Retrieve all unique values from the product_id_device column to use as interesting values. You can optionally pick a subset. ```python interesting_values = transactions_df["product_id_device"].unique().tolist() interesting_values ``` -------------------------------- ### Create cutoff times DataFrame for training_window Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Creates a DataFrame with customer_id, time, and label columns to specify unique cutoff times for each customer. This is used with the training_window parameter in ft.dfs. ```python cutoff_times = pd.DataFrame() cutoff_times["customer_id"] = [1, 2, 3, 1] cutoff_times["time"] = pd.to_datetime( ["2014-1-1 04:00", "2014-1-1 05:00", "2014-1-1 06:00", "2014-1-1 08:00"] ) cutoff_times["label"] = [True, True, False, True] feature_matrix, feature_defs = ft.dfs( entityset=es, target_dataframe_name="customers", cutoff_time=cutoff_times, cutoff_time_in_index=True, training_window="1 hour", ) feature_matrix.head() ``` -------------------------------- ### Access secondary time index metadata (1.0) Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Starting in Featuretools 1.0, the secondary time index and associated columns are stored in the Woodwork dataframe metadata and can be accessed via the ww.metadata attribute. ```python es_flight["trip_logs"].ww.metadata["secondary_time_index"] ``` -------------------------------- ### Create training data DataFrame Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Creates a pandas DataFrame with customer data including a labels column. Used as the training data in the no-timestamps workflow. ```python train_data = pd.DataFrame( { "customer_id": [1, 2, 3, 4, 5], "age": [40, 50, 10, 20, 30], "gender": ["m", "f", "m", "f", "f"], "signup_date": pd.date_range("2014-01-01 01:41:50", periods=5, freq="25min"), "labels": [True, False, True, False, True], } ) train_data.head() ``` -------------------------------- ### Define identity feature with new syntax (1.0) Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Starting with Featuretools 1.0, use .ww between the dataframe selector and the column selector to access the Woodwork column. This replaces the old syntax that directly accessed the variable. ```python feature = ft.Feature(es["items"].ww["item_price"]) ``` -------------------------------- ### Set column logical type to match parent (hidden setup) Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb This hidden cell changes the child column logical type to match the parent and prevent a warning. It is part of the docs build and not shown to users. ```python # Undo change from above and change child column logical type to match parent and prevent warning # NOTE: This cell is hidden in the docs build es["items"].ww.set_types(logical_types={"order_id": "Integer"}) ``` -------------------------------- ### View Woodwork typing information for order_products Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Shows the Woodwork typing information for the 'order_products' DataFrame, including logical types and semantic tags for each column. ```python es["order_products"].ww ``` -------------------------------- ### DFS with cutoff time and sum aggregation Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Runs DFS with sum aggregation and a cutoff time, producing results equivalent to cum_sum. ```python feature_matrix, feature_defs = ft.dfs( target_dataframe_name="observations", entityset=es, agg_primitives=["sum"], trans_primitives=[], groupby_trans_primitives=[], cutoff_time_in_index=True, cutoff_time=cutoff_time, ) feature_matrix ``` -------------------------------- ### Run DFS with seed feature and ignore_columns Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Runs ft.dfs on the training EntitySet, ignoring the 'labels' column for feature creation but including it as a seed feature via ft.Feature. Returns the feature matrix and feature definitions. ```python labels_feature = ft.Feature(es_train_data["customers"].ww["labels"]) feature_matrix_train, feature_defs = ft.dfs( entityset=es_train_data, target_dataframe_name="customers", ignore_columns={"customers": ["labels"]}, seed_features=[labels_feature], ) feature_matrix_train ``` -------------------------------- ### Load and merge mock customer data Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/using_entitysets.ipynb Loads the mock customer dataset and merges transactions, sessions, and customers into a single dataframe for demonstration. ```python import featuretools as ft data = ft.demo.load_mock_customer() transactions_df = data["transactions"].merge(data["sessions"]).merge(data["customers"]) transactions_df.sample(10) ``` -------------------------------- ### Upgrade Featuretools on Google Colab Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Upgrades Featuretools to the latest version in a Google Colab notebook. Colab defaults to Featuretools 0.4.1, which may cause issues with newer guides; restart the runtime after upgrading. ```shell !pip install -U featuretools ``` -------------------------------- ### Define StringCount transform primitive with additional argument Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/advanced_custom_primitives.ipynb Creates a custom TransformPrimitive that counts occurrences of a specified string in a text column. The string is passed as a keyword argument to __init__ and used in the get_function closure. ```python class StringCount(TransformPrimitive): """Count the number of times the string value occurs.""" name = "string_count" input_types = [ColumnSchema(logical_type=NaturalLanguage)] return_type = ColumnSchema(semantic_tags={"numeric"}) def __init__(self, string=None): self.string = string def get_function(self): def string_count(column): assert self.string is not None, "string to count needs to be defined" # this is a naive implementation used for clarity counts = [text.lower().count(self.string) for text in column] return counts return string_count ``` -------------------------------- ### Preview sessions dataframe Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/using_entitysets.ipynb Shows the first five rows of the 'sessions' dataframe to illustrate the effect of normalize_dataframe on the actual data. ```python es["sessions"].head(5) ``` -------------------------------- ### Select deep feature MODE(sessions.HOUR(session_start)) Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/afe.ipynb Selects the depth-2 feature 'MODE(sessions.HOUR(session_start))' from the feature matrix. This feature extracts the hour of each session start, then finds the most common hour per customer. ```python feature_matrix[["MODE(sessions.HOUR(session_start))"]] ``` -------------------------------- ### Normalize and plot to see new semantic tags Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Normalizes transactions to create sessions with session_start as time_index, then plots to show new semantic tags. ```python es = es.normalize_dataframe( base_dataframe_name="transactions", new_dataframe_name="sessions", index="session_id", make_time_index="session_start", additional_columns=["session_start"], ) es.plot() ``` -------------------------------- ### Generate features with HourlySineAndCosine using DFS Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/advanced_custom_primitives.ipynb Pass the HourlySineAndCosine primitive into DFS to generate features. The feature matrix will include columns named 'HOURLY_SINE_AND_COSINE(datetime)[sine]' and 'HOURLY_SINE_AND_COSINE(datetime)[cosine]' reflecting the custom naming. ```python feature_matrix, features = ft.dfs( entityset=es, target_dataframe_name="log", agg_primitives=[], trans_primitives=[HourlySineAndCosine], ) feature_matrix.head()[ [ "HOURLY_SINE_AND_COSINE(datetime)[sine]", "HOURLY_SINE_AND_COSINE(datetime)[cosine]", ] ] ``` -------------------------------- ### Old EntitySet creation with entity_from_dataframe Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/transition_to_ft_v1.0.ipynb Shows the pre-1.0 method of adding dataframes to an EntitySet using entity_from_dataframe. ```python es = ft.EntitySet('old_es') es.entity_from_dataframe(dataframe=orders_df, entity_id='orders', index='order_id', time_index='order_date') es.entity_from_dataframe(dataframe=items_df, entity_id='items', index='id') ``` ```text Entityset: old_es Entities: orders [Rows: 3, Columns: 2] items [Rows: 5, Columns: 3] Relationships: No relationships ``` -------------------------------- ### Generate features with CaseCount using DFS Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/advanced_custom_primitives.ipynb Pass the `CaseCount` primitive to `ft.dfs` to generate features. The resulting feature matrix includes columns named `customers.CASE_COUNT(favorite_quote)[0]` and `customers.CASE_COUNT(favorite_quote)[1]`, reflecting the output index. ```python feature_matrix, features = ft.dfs( entityset=es, target_dataframe_name="sessions", agg_primitives=[], trans_primitives=[CaseCount], ) feature_matrix[ [ "customers.CASE_COUNT(favorite_quote)[0]", "customers.CASE_COUNT(favorite_quote)[1]", ] ] ``` -------------------------------- ### Run DFS on a single table using an EntitySet Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Creates an EntitySet with a single transactions dataframe and runs DFS with transform primitives. This approach allows using DFS on a single table, though aggregation primitives are not available. ```python transactions_df = ft.demo.load_mock_customer(return_single_table=True) es = ft.EntitySet(id="customer_data") es = es.add_dataframe( dataframe_name="transactions", dataframe=transactions_df, index="transaction_id", time_index="transaction_time", ) feature_matrix, feature_defs = ft.dfs( entityset=es, target_dataframe_name="transactions", trans_primitives=[ "time_since", "day", "is_weekend", "cum_min", "minute", "weekday", "percentile", "year", "week", "cum_mean", ], ) ``` -------------------------------- ### Create EntitySet for training data Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Builds an EntitySet from the training DataFrame, setting 'customer_id' as the index. This EntitySet is used for feature engineering on training data. ```python es_train_data = ft.EntitySet(id="customer_train_data") es_train_data = es_train_data.add_dataframe( dataframe_name="customers", dataframe=train_data, index="customer_id" ) es_train_data ``` -------------------------------- ### Use StringCount primitive in DFS with string='the' Source: https://github.com/alteryx/featuretools/blob/main/docs/source/guides/advanced_custom_primitives.ipynb Runs deep feature synthesis on the ecommerce entityset using the StringCount primitive with the string argument set to 'the'. The resulting feature names include the string value in the feature name. ```python es = make_ecommerce_entityset() feature_matrix, features = ft.dfs( entityset=es, target_dataframe_name="sessions", agg_primitives=["sum", "mean", "std"], trans_primitives=[StringCount(string="the")], ) feature_matrix[ [ "STD(log.STRING_COUNT(comments, string=the))", "SUM(log.STRING_COUNT(comments, string=the))", "MEAN(log.STRING_COUNT(comments, string=the))", ] ] ``` -------------------------------- ### Add last_time_index to all dataframes Source: https://github.com/alteryx/featuretools/blob/main/docs/source/resources/frequently_asked_questions.ipynb Loads the mock customer entityset and calls add_last_time_indexes() to set last_time_index on all dataframes, removing the 'Using training_window but last_time_index is not set' warning. ```python es = ft.demo.load_mock_customer(return_entityset=True) es.add_last_time_indexes() ``` -------------------------------- ### List Logical Types with ft.list_logical_types() Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/woodwork_types.ipynb Use this to see all logical types available in Woodwork. Logical types add meaning beyond physical types and inform how data is read into an EntitySet and used in Deep Feature Synthesis. ```python import featuretools as ft ft.list_logical_types() ``` -------------------------------- ### Comparing Feature Counts with and without Training Window Source: https://github.com/alteryx/featuretools/blob/main/docs/source/getting_started/handling_time.ipynb Shows the same feature column from the feature matrix with and without a training window to illustrate the effect on counts. ```python fm[["COUNT(transactions)"]] ``` ```python window_fm[["COUNT(transactions)"]] ```