dataeval.detectors.drift.DriftUncertainty ========================================= .. py:class:: dataeval.detectors.drift.DriftUncertainty(x_ref, model, p_val = 0.05, x_ref_preprocessed = False, update_x_ref = None, preds_type = 'probs', batch_size = 32, preprocess_batch_fn = None, device = None) Test for a change in the number of instances falling into regions on which the model is uncertain. Performs a K-S test on prediction entropies. :param x_ref: Data used as reference distribution. :type x_ref: ArrayLike :param model: :term:`Classification` model outputting class probabilities (or logits) :type model: Callable :param p_val: :term:`P-Value` used for the significance of the test. :type p_val: float, default 0.05 :param x_ref_preprocessed: Whether the given reference data ``x_ref`` has been preprocessed yet. If ``True``, only the test data ``x`` will be preprocessed at prediction time. If ``False``, the reference data will also be preprocessed. :type x_ref_preprocessed: bool, default False :param update_x_ref: Reference data can optionally be updated using an UpdateStrategy class. Update using the last n instances seen by the detector with LastSeenUpdateStrategy or via reservoir sampling with ReservoirSamplingUpdateStrategy. :type update_x_ref: UpdateStrategy | None, default None :param preds_type: Type of prediction output by the model. Options are 'probs' (in [0,1]) or 'logits' (in [-inf,inf]). :type preds_type: "probs" | "logits", default "logits" :param batch_size: Batch size used to evaluate model. Only relevant when backend has been specified for batch prediction. :type batch_size: int, default 32 :param preprocess_batch_fn: Optional batch preprocessing function. For example to convert a list of objects to a batch which can be processed by the model. :type preprocess_batch_fn: Callable | None, default None :param device: Device type used. The default None tries to use the GPU and falls back on CPU if needed. Can be specified by passing either 'cuda', 'gpu' or 'cpu'. :type device: str | None, default None .. py:method:: predict(x) Predict whether a batch of data has drifted from the reference data. :param x: Batch of instances. :type x: ArrayLike :returns: Dictionary containing the drift prediction, :term:`p-value`, and threshold statistics. :rtype: DriftUnvariateOutput