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​
- Navigate to Feature Groups from the main menu.
- Click Add Feature Group.
- Select the Python Feature Group option.
Using the Feature Group Wizard​
- Name Your Feature Group: Enter a descriptive name for your Python feature group.
- Choose Creation Method: Select "Define using a new Python function".
- 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
- Add Input Feature Groups: Specify any required input feature groups (e.g., an existing feature group like "churn").
- 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​
- Go to your main menu.
- Select the Python feature group you want to edit.
- Click Edit Code.
- 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