Skip to main content

adaptive_profiler

AutoML anomaly detection and schema-driven data quality checks for ETL pipelines.

Detects semantic anomalies that rule-based checks miss — stuck sensors, silent feeds, values that are numerically valid but statistically unusual. Each column gets its own model, trained on recent data, configured through a single YAML file.

Features

  • Two-layer quality checking — rule-based data contract checks + ML-based anomaly detection, both declared in one YAML file
  • AutoML via Optuna — searches over IForest, LOF, HBOS, COPOD, and ECOD; selects the best model per column automatically
  • Per-source isolation — each (partition × column) pair trains its own model; amsterdam and london never share a model
  • Configurable training window — train on the N most-recent rows rather than the full history to keep retraining fast
  • Manual model override — pin a specific algorithm and hyperparameters per column to skip Optuna entirely
  • Tunable flag threshold — override the binary flagging threshold per column on a validation split without retraining
  • Built-in cost projection — ScalingBenchmark fits T(n,m,k) = α·n^β·m^δ·k^γ so you can predict overhead before committing to production
  • Pipeline-safe output — failures reported in the output DataFrame, never raised as exceptions

Install

pip install adaptive-profiler
pip install "adaptive-profiler[s3]"   # include boto3 for S3 storage

For development (from source):

git clone https://github.com/kooroshkz/adaptive-profiler
cd adaptive-profiler
pip install -e ".[dev]"

Quick start

from adaptive_profiler import Profiler

profiler = Profiler.from_yaml("profiling_schema.yml")

# Train models — one per (city, column) pair
results = profiler.train(partition_key="amsterdam", df=historical_df)
for r in results:
    print(r)

# Score incoming data — returns long-format DataFrame
predictions = profiler.score(partition_key="amsterdam", df=new_df)
print(predictions[predictions["automl_flag"] == 1])

# Rule-based checks only
violations = profiler.check_quality(df=new_df)

Cost projection

from adaptive_profiler import ScalingBenchmark

bench = ScalingBenchmark(df, columns=["temperature_2m", "pressure"])
bench.run(quick=True)   # ~1–2 min
bench.fit()
print(bench.report(target_n=100_000, m=6, k=25))
t = bench.predict(n=100_000, m=6, k=25)

Running tests

pytest

Module layout

File Purpose
profiler.py Main Profiler class — train(), score(), check_quality()
schema.py YAML config dataclasses — ProfilerConfig, ColumnConfig, TrainingConfig
trainer.py Optuna HPO loop, manual override path, TrainingResult
models.py PyOD model registry and Optuna search-space definitions
quality.py Rule-based quality checks, check_dataframe(), quality_summary()
store.py S3Store, LocalStore, ArtifactStore protocol
projection.py ScalingBenchmark — benchmark, fit power-law, predict and report

Metadata

Release files for adaptive-profiler 0.2.0

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

Source distribution (sdist)

Source distribution for adaptive-profiler 0.2.0
File Size Uploaded Provenance Actions
adaptive_profiler-0.2.0.tar.gz 29.1 kB With provenance Details for adaptive_profiler-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adaptive-profiler 0.2.0
File Interpreter ABI Platform Actions
adaptive_profiler-0.2.0-py3-none-any.whl Python 3 none any Details for adaptive_profiler-0.2.0-py3-none-any.whl

Total release size: 55.6 kB

Release files / adaptive_profiler-0.2.0.tar.gz

Download URL adaptive_profiler-0.2.0.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
036b925dcc9a56f896bd7608313d85f6933eca23263bb62535824ae2a6f10d1a
BLAKE2b-256 checksum
How to use checksums
eccb3fd1af3bbb6039859c237211ea821ac8ddb06c221df9aa05166a246029a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

Release files / adaptive_profiler-0.2.0-py3-none-any.whl

Download URL adaptive_profiler-0.2.0-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea0e9b6eff68c2f877374b8703067a5209a125c58650dab0d44b9cffee5c1998
BLAKE2b-256 checksum
How to use checksums
e19e88f53dbf3eda17580304f015016a19ba64a7a0a9abbc8c22b26d585ddab7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

Security for adaptive-profiler 0.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for adaptive_profiler-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

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.2.0 This release

2 release files Full 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