dataeval.detectors.drift.DriftKS ================================ .. py:class:: dataeval.detectors.drift.DriftKS(x_ref, p_val = 0.05, x_ref_preprocessed = False, update_x_ref = None, preprocess_fn = None, correction = 'bonferroni', alternative = 'two-sided', n_features = None) :term:`Drift` detector employing the Kolmogorov-Smirnov (KS) distribution test. The KS test detects changes in the maximum distance between two data distributions with Bonferroni or :term:`False Discovery Rate (FDR)` correction for multivariate data. :param x_ref: Data used as reference distribution. :type x_ref: ArrayLike :param p_val: :term:`p-value` used for significance of the statistical test for each feature. If the FDR correction method is used, this corresponds to the acceptable q-value. :type p_val: float | None, 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 preprocess_fn: Function to preprocess the data before computing the data :term:`drift` metrics. Typically a :term:`dimensionality reduction` technique. :type preprocess_fn: Callable | None, default None :param correction: Correction type for multivariate data. Either 'bonferroni' or 'fdr' (False Discovery Rate). :type correction: "bonferroni" | "fdr", default "bonferroni" :param alternative: Defines the alternative hypothesis. Options are 'two-sided', 'less' or 'greater'. :type alternative: "two-sided" | "less" | "greater", default "two-sided" :param n_features: Number of features used in the statistical test. No need to pass it if no preprocessing takes place. In case of a preprocessing step, this can also be inferred automatically but could be more expensive to compute. :type n_features: int | None, default None .. py:method:: score(x) Compute KS scores and :term:Statistics` per feature. :param x: Batch of instances. :type x: ArrayLike :returns: Feature level :term:p-values and KS statistic :rtype: tuple[NDArray, NDArray]