Skip to main content

README

sklearn-llm is a Python module for building data transformation pipelines combining the power of scikit-learn and Large Language Models (LLMs).

Installation

The easiest way to install is with pip:

pip install sklearn-llm

See pyproject.toml for the list of dependencies.

Pre-requisites

You will also need an API key from OpenAI to use its LLM models for your data transformations. Currently it's the only supported LLM provider.

Set the OPENAI_API_KEY variable in a .env file, following the same format as .env_example.

Quick guide

To define a transformation, you need the following:

  • An input class and an output class, both should be Pydantic base models.
  • The prompts (system and user prompt) for the transformation.

See sklearn_llm/example.py for an example.

Benefits

With sklearn-llm, you can do the following:

  • Define data transformations in sklearn's Transformer interface using LLM calls.
  • Use type hints to enhance understanding of the data transformation flows (instead of generic dataframes).
  • Compose flexible transformations using sklearn's Pipeline interface. This is similar to building chain of LLM calls in langchain but simpler if you only require this use case.

Example applications:

  • Create a pipeline to generate synthetic data and evaluate the quality of the data using two transformers.

Metadata

Release files for sklearn-llm 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sklearn-llm 0.1.1
File Size Uploaded Provenance Actions
sklearn_llm-0.1.1.tar.gz 4.6 kB Without provenance Details for sklearn_llm-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sklearn-llm 0.1.1
File Interpreter ABI Platform Actions
sklearn_llm-0.1.1-py3-none-any.whl Python 3 none any Details for sklearn_llm-0.1.1-py3-none-any.whl

Total release size: 10.5 kB

Release files / sklearn_llm-0.1.1.tar.gz

Download URL sklearn_llm-0.1.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b41a52563f7eaca43a81a8dcfeeab3c772ea7da86ea6b4656bbfcc324131aa1a
BLAKE2b-256 checksum
How to use checksums
fbf2e03bedb32ec6ca96a34ca51f776d960d3c26266435403ac51fc6423f2906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / sklearn_llm-0.1.1-py3-none-any.whl

Download URL sklearn_llm-0.1.1-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea43d7c60bfe4b5ac1f2354119f4f3cf86c2e05dc71cb1e1e425aeb8b85450c9
BLAKE2b-256 checksum
How to use checksums
77e5203a79402a9ecfc6ff88df24082e8a007ee3067f361d2548adda9524c312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for sklearn-llm 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page