Skip to main content

Python Feature Group

Learning Objectives​

  • Python for Preprocessing: Techniques for preprocessing data using Python.
  • Creating Feature Groups: Steps to create feature groups with Python.

Watch the Tutorial​

Creating a Python Feature Group​

Python feature groups allow you to define custom data transformations using Python code within the Abacus platform. Follow these steps to create and manage Python feature groups.

Creating a New Python Feature Group​

  1. Navigate to Feature Groups from the main menu.
  2. Click Add Feature Group.
  3. Select the Python Feature Group option.

Using the Feature Group Wizard​

  1. Name Your Feature Group: Enter a descriptive name for your Python feature group.
  2. Choose Creation Method: Select "Define using a new Python function".
  3. Configure Settings (optional):
    • Set Python package requirements
    • Specify memory usage
    • Enable GPU if needed
    • Note: These settings can be changed later within the function code
  4. Add Input Feature Groups: Specify any required input feature groups (e.g., an existing feature group like "churn").
  5. Click Next Step.

Working with the Notebook​

After clicking on Next Step, Abacus will spin up a notebook with pre-generated code that includes:

  • Python function definition template
  • Feature group creation code
  • Testing functionality

Execute all cells serially to register your Python feature group.

Important Concepts​

Input Data Format: When passing a feature group into a Python function, it automatically converts to a Pandas DataFrame that can be used within your code.

Compatibility: Python feature groups work seamlessly with SQL feature groups. You can create SQL feature groups that use data from both Python and SQL feature groups.

Library Imports: Add all required library imports inside the function definition to ensure they're available during execution.

Editing an Existing Python Feature Group​

  1. Go to your main menu.
  2. Select the Python feature group you want to edit.
  3. Click Edit Code.
  4. A new notebook will open with:
    • Code to update your existing Python function
    • Testing functionality for the updated function

Important Notes:

  • All changes in this notebook are temporary
  • Do not save unfinished work here
  • The notebook always opens fresh with the latest deployed version
  • Apply your changes, run all cells, and the function will update automatically