Skip to main content

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
  • 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
      

Setup

  1. Clone the repository

    git clone https://github.com/stepfnAI/feature_suggestion_agent.git
    cd feature_suggestion_agent/
    git checkout dev
    
  2. Set up the virtual environment and install dependencies This command creates a .venv folder in the current directory and installs all required packages.

    uv sync --extra dev
    source .venv/bin/activate
    
  3. Clone and install the sfn_blueprint dependency: The agent requires the sfn_blueprint library. 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
    
  4. 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 implementation
    • models.py: Data models and schemas
    • constants.py: prompts
    • config.py: model configurations
  • Dependencies:

    • sfn-blueprint: Core framework and utilities
    • pydantic: Data validation

🤝 Contributing

📝 License

[Add your license information here]

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📧 Contact

puneet@stepfunction.ai

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

feature_suggestion_agent-0.1.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

feature_suggestion_agent-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file feature_suggestion_agent-0.1.1.tar.gz.

File metadata

  • Download URL: feature_suggestion_agent-0.1.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for feature_suggestion_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a4fe44259f360cfd9b816d7fee2daf59ec7da0ac44d1d3a76e4209f14017e967
MD5 d22ed1e92145ce63846a4f1f4d54b5f3
BLAKE2b-256 6f5585b155b9d6bb3b4e213dd407836de74f1ccab2fded6831cfec9fd766b315

See more details on using hashes here.

File details

Details for the file feature_suggestion_agent-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for feature_suggestion_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86ac0699fd4c3329e91ef0fb61449fbf9cc45da091bdb41d5651abedfddc1ae0
MD5 99e41e1fe8a8139c25470a17e2f6d5ae
BLAKE2b-256 c9b4a5bbf9a7887f327bc951840d396ab8230d326e4b4dcb05ac81f12c996bd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page