Skip to main content

LLM-powered modular data science pipeline

Project description

Data Science Pro

AI-agentic, LLM-augmented data science pipeline for CSV datasets. It performs EDA, preprocessing, modeling, evaluation, and reporting with minimal user code.

Install

pip install -e .
# or when released
# pip install data-science-pro

Verify:

import data_science_pro
from data_science_pro import DataSciencePro

Quickstart (Python API)

Minimal end-to-end run that generates a markdown report:

from data_science_pro import DataSciencePro

dsp = DataSciencePro(api_key="YOUR_OPENAI_KEY")  # or "" to run without LLM/RAG embeddings

# Optional guidance to the agent
dsp.controller.goal = "Predict churn with strong accuracy"
dsp.controller.user_target = "churn"  # optional; if omitted the agent will infer

final = dsp.run("/path/to/data.csv")
print(final.get("report", "No report produced"))

What happens:

  • Loads your CSV, performs EDA and indexes summaries (RAG) for retrieval
  • Plans and suggests next steps
  • Selects/validates the target
  • Iterates: preprocess → train → evaluate → critique → improve
  • Stops on target metric or max iterations and produces a professional report

Notes:

  • When api_key is empty or a test value, RAG uses a local mode and still runs.
  • Set dsp.controller.goal (string) to guide the agent. Set dsp.controller.user_target (string) to force the target column.

Beginner-Friendly Example

from data_science_pro import DataSciencePro

dsp = DataSciencePro(api_key="")  # run without external LLM (RAG in local mode)
final = dsp.run("titanic.csv")
print(final["report"])  # Executive summary, EDA, preprocessing, modeling, metrics, recommendations

Advanced Usage (Experienced DS)

Control the agent through state:

from data_science_pro import DataSciencePro

dsp = DataSciencePro(api_key="YOUR_OPENAI_KEY")

# Configure agent objectives
dsp.controller.goal = "Reach accuracy >= 0.90 with interpretable model"
dsp.controller.user_target = None  # let the agent choose from candidates

# (Optional) adjust loop parameters directly by editing controller.run() defaults if needed
state = dsp.run("/data/training.csv")

# Inspect artifacts
print(state.get("analysis"))           # EDA summary
print(state.get("retrieved_context"))  # RAG snippets
print(state.get("evaluation"))         # metrics dict
print(state.get("history"))            # actions taken across iterations

Key Concepts

  • Agentic LangGraph

    • Orchestrator decides next step (analyze, preprocess, train, evaluate, report)
    • Planner proposes a concise plan; Critic flags quality issues
    • TargetSelector chooses target via user hint > LLM > heuristic
  • RAG over EDA

    • Indexes column and dataset summaries (missingness, cardinality, basic stats)
    • Retrieves relevant context to ground suggestions and reports
    • Uses OpenAI embeddings when api_key is valid; falls back to local mode otherwise
  • Reporting

    • Structured markdown report with executive summary, EDA highlights, preprocessing, modeling, metrics, and recommendations

Troubleshooting

  • No OpenAI key: set api_key="" to run without external calls; RAG runs in local mode.
  • Target not detected: set dsp.controller.user_target = "your_target".
  • Healthcheck: run a local end-to-end check without network calls:
python corrected_imports.py

FAQ

  • Does it handle large CSVs? Yes, but consider sampling for initial iterations.
  • Can I change the model? The agent selects sensible defaults; you can modify Trainer to register alternatives.
  • Where is the final report? Returned in final_state["report"].

License

MIT

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

data_science_pro-0.2.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

data_science_pro-0.2.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file data_science_pro-0.2.0.tar.gz.

File metadata

  • Download URL: data_science_pro-0.2.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.13

File hashes

Hashes for data_science_pro-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cc72e68449de4ac3056d277e5584dadfc6018c32b0ab19d5fd34c42ef3a2499f
MD5 6f3a3319566c3dca9741e202431d2d0c
BLAKE2b-256 7ee9184ea5ca041b33ae9c359d2c134ad4f03b38244f69a8d045c68ee8987e61

See more details on using hashes here.

File details

Details for the file data_science_pro-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for data_science_pro-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d608602a13d2cb03ded823bb3519fbbcce9dc2b653ddcc0538c80490d8872104
MD5 a1878fbe3bde4afad4393be9a93edea7
BLAKE2b-256 20a730b5bdfa318d122e6ff6508e7abf754677ee9f124d8eceef31cfc7c67e2a

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