dataeval.shift.ChunkedDrift¶
-
class dataeval.shift.ChunkedDrift(detector, chunker=
None, chunk_size=None, chunk_count=None, threshold=None)¶ Chunked drift detection wrapper.
Wraps a
BaseDriftdetector that also inheritsChunkableMixinto perform chunked evaluation. Duringfit(), splits reference data into chunks and computes baseline metric values. Duringpredict(), 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.
-
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
chunksis provided.- chunks : list[Any] or None, default None¶
Pre-built test data chunks. When provided, each array is treated as a separate chunk and
datais ignored.- chunk_indices : list[list[int]] or None, default None¶
Index groupings for chunking
data. Each inner list specifies which samples fromdatabelong to a chunk.
- Returns:¶
Per-chunk results with a
polars.DataFrameindetails.- Return type:¶
DriftChunkedOutput