dataeval.shift.ChunkedDrift

class dataeval.shift.ChunkedDrift(detector, chunker=None, chunk_size=None, chunk_count=None, threshold=None)

Chunked drift detection wrapper.

Wraps a BaseDrift detector that also inherits ChunkableMixin to perform chunked evaluation. During fit(), splits reference data into chunks and computes baseline metric values. During predict(), splits test data into chunks, scores each against the fitted reference, and compares to threshold bounds.

Typically created via BaseDrift.chunked() rather than directly.

Parameters:
detector : BaseDrift

The underlying drift detector (must also be a ChunkableMixin).

chunker : BaseChunker or None, default None

Explicit chunker instance.

chunk_size : int or None, default None

Create fixed-size chunks.

chunk_count : int or None, default None

Split into this many equal chunks.

threshold : Threshold or None, default None

Threshold strategy for drift bounds.

fit(reference_data, /)

Fit the underlying detector and compute chunked baseline.

Delegates to the underlying detector’s fit() method, then splits the reference data into chunks and computes baseline metric values for threshold comparison.

Parameters:
reference_data : Any

Reference dataset. Passed to the underlying detector’s fit().

Return type:

Self

predict(data=None, chunks=None, chunk_indices=None)

Predict drift using chunked evaluation.

Splits test data into chunks, computes per-chunk metrics, and compares against baseline thresholds.

Parameters:
data : Any, optional

Test dataset to analyze. Split into chunks using the fitted chunker. Required unless chunks is provided.

chunks : list[Any] or None, default None

Pre-built test data chunks. When provided, each array is treated as a separate chunk and data is ignored.

chunk_indices : list[list[int]] or None, default None

Index groupings for chunking data. Each inner list specifies which samples from data belong to a chunk.

Returns:

Per-chunk results with a polars.DataFrame in details.

Return type:

DriftChunkedOutput