alibi_detect.od.sklearn.base
FitMixinSklearn
FitMixinSklearnInherits from: ABC
Methods
check_fitted
check_fittedcheck_fitted()Checks to make sure object has been fitted.
fit
fitfit(x_ref: numpy.ndarray) -> typing_extensions.SelfAbstract fit method.
x_ref
numpy.ndarray
x
torch.Tensor to fit object on.
Returns
Type:
typing_extensions.Self
SklearnOutlierDetector
SklearnOutlierDetectorInherits from: FitMixinSklearn, ABC
Base class for sklearn backend outlier detection algorithms.
Methods
check_threshold_inferred
check_threshold_inferredcheck_threshold_inferred()Check if threshold is inferred.
infer_threshold
infer_thresholdinfer_threshold(x: numpy.ndarray, fpr: float) -> NoneInfer the threshold for the data. Prerequisite for outlier predictions.
x
numpy.ndarray
Data to infer the threshold for.
fpr
float
False positive rate to use for threshold inference.
Returns
Type:
None
predict
predictpredict(x: numpy.ndarray) -> alibi_detect.od.sklearn.base.SklearnOutlierDetectorOutputPredict outlier labels for the data.
Computes the outlier scores. If the detector is not fit on reference data we raise an error. If the threshold is inferred, the outlier labels and p-values are also computed and returned. Otherwise, the outlier labels and p-values are set to None.
x
numpy.ndarray
Data to predict.
Returns
Type:
alibi_detect.od.sklearn.base.SklearnOutlierDetectorOutput
score
scorescore(x: numpy.ndarray) -> numpy.ndarrayScore the data.
x
numpy.ndarray
Data to score.
Returns
Type:
numpy.ndarray
SklearnOutlierDetectorOutput
SklearnOutlierDetectorOutputOutput of the outlier detector.
Fields
threshold_inferred
bool
``
instance_score
numpy.ndarray
``
threshold
Optional[numpy.ndarray]
``
is_outlier
Optional[numpy.ndarray]
``
p_value
Optional[numpy.ndarray]
``
Constructor
SklearnOutlierDetectorOutput(self, threshold_inferred: bool, instance_score: numpy.ndarray, threshold: Optional[numpy.ndarray], is_outlier: Optional[numpy.ndarray], p_value: Optional[numpy.ndarray]) -> Nonethreshold_inferred
bool
instance_score
numpy.ndarray
threshold
Optional[numpy.ndarray]
is_outlier
Optional[numpy.ndarray]
p_value
Optional[numpy.ndarray]
Last updated
Was this helpful?

