An intelligent agent for suggesting features for machine learning datasets
Project description
Feature Suggestion Agent
The Feature Suggestion Agent is an intelligent agent that uses LLMs (Large Language Models) to automatically generate and suggest features for machine learning tasks. It can produce feature definitions, formulas, reasoning, and SQL queries for dataset transformation.
Features
- Accepts dataset metadata, target information, and modeling approach.
- Generates new feature suggestions using an LLM.
- Provides:
- Feature name (
title) - Columns used (
columns_involved) - Calculation logic (
formula_logic) - Reasoning for usefulness
- SQL to create the feature
- Aggregation/grouping info for window or group operations
- Feature name (
- Parses LLM responses into validated Pydantic models.
📦 Installation
Prerequisites
- Python 3.11+
- Git
- uv – A fast Python package and environment manager.
- For a quick setup on macOS/Linux, you can use:
curl -LsSf https://astral.sh/uv/install.sh | sh
- For a quick setup on macOS/Linux, you can use:
Setup
-
Clone the repository
git clone https://github.com/stepfnAI/feature_suggestion_agent.git cd feature_suggestion_agent/ git checkout dev
-
Set up the virtual environment and install dependencies This command creates a
.venvfolder in the current directory and installs all required packages.uv sync --extra dev source .venv/bin/activate
-
Clone and install the
sfn_blueprintdependency: The agent requires thesfn_blueprintlibrary. The following commands clone it into a sibling directory and install it in editable mode.cd .. git clone https://github.com/stepfnAI/sfn_blueprint.git cd sfn_blueprint git switch dev uv pip install -e . cd ../feature_suggestion_agent
-
Set up environment variables
# Optional: Configure LLM provider (default: openai) export LLM_PROVIDER="your_llm_provider" # Optional: Configure LLM model (default: gpt-4.1-mini) export LLM_MODEL="your_llm_model" # Required: Your LLM API key (Note: If LLM provider is opeani then 'export OPENAI_API_KEY', if it antropic 'export ANTROPIC_API_KEY', use this accordingly as per LLM provider ) export OPENAI_API_KEY="your_llm_api_key"
🛠️ Usage
Basic Usage
python examples/basic_usage.py
🧪 Testing
Run the test file:
pytest -v -s tests/test1.py
🏗️ Architecture
The Target Synthesis Agent is built with a modular architecture:
-
Core Components:
agent.py: Base agent implementationmodels.py: Data models and schemasconstants.py: promptsconfig.py: model configurations
-
Dependencies:
sfn-blueprint: Core framework and utilitiespydantic: Data validation
🤝 Contributing
📝 License
[Add your license information here]
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📧 Contact
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file feature_suggestion_agent-0.1.4.tar.gz.
File metadata
- Download URL: feature_suggestion_agent-0.1.4.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76801764ffc5147ff4c0e3ad054b87bd3a46ee7a189049c8bbf6ceee190cc7dc
|
|
| MD5 |
8c7bf2b97754d5414e6d49d1abe282a0
|
|
| BLAKE2b-256 |
f414efed2a90f6d5df1dc2069cb4281791d8eb0aa05f4b56d7c9cefb4a2892eb
|
File details
Details for the file feature_suggestion_agent-0.1.4-py3-none-any.whl.
File metadata
- Download URL: feature_suggestion_agent-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cd075372f8ad5b1be2717bbe82576b7abab5f96be7a569b9cd2b1e3a51fb60a
|
|
| MD5 |
c2b40fe5b193ec0fe152110f6f9d852a
|
|
| BLAKE2b-256 |
e87ec682c200b20bada47a1aaaa3bb5a06de7ced478966c70a292b8e11143f1a
|