dataeval.detectors.drift.preprocess_drift

dataeval.detectors.drift.preprocess_drift(x, model, device=None, preprocess_batch_fn=None, batch_size=int(10000000000.0), dtype=np.float32)

Prediction function used for preprocessing step of drift detector.

Parameters:
x : NDArray

Batch of instances.

model : nn.Module

Model used for preprocessing.

device : DeviceLike or None, default None

The hardware device to use if specified, otherwise uses the DataEval default or torch default.

preprocess_batch_fn : Callable or None, default None

Optional batch preprocessing function. For example to convert a list of objects to a batch which can be processed by the PyTorch model.

batch_size : int, default 1e10

Batch size used during prediction.

dtype : np.dtype or torch.dtype, default np.float32

Model output type, either a NumPy or torch dtype, e.g. np.float32 or torch.float32.

Returns:

Numpy array, torch tensor or tuples of those with model outputs.

Return type:

NDArray | torch.Tensor | tuple