dqm_ml_core.api.features_processor
Features processor base class.
This module contains the FeaturesProcessor base class that all feature extraction processors must inherit from.
FeaturesProcessor
Bases: Processor
Base class for all feature extraction processors.
Feature processors transform raw data into per-sample features
(e.g., image luminosity, embeddings). The primary lifecycle method
is compute_features, which produces a dict of feature arrays
from each batch of raw data.
Source code in packages/dqm-ml-core/src/dqm_ml_core/api/features_processor.py
compute_features(batch: pa.RecordBatch, prev_features: dict[str, pa.Array]) -> dict[str, pa.Array]
Transform a raw data batch into features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
batch
|
RecordBatch
|
The input pyarrow RecordBatch. |
required |
prev_features
|
dict[str, Array]
|
Features already computed by preceding processors. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Array]
|
A dictionary mapping feature names to pyarrow Arrays. |
Source code in packages/dqm-ml-core/src/dqm_ml_core/api/features_processor.py
generated_features() -> list[str]
Return the list of columns generated by this processor during feature extraction.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of feature names. |