class_docstr: Base class for sklearn backend outlier detection algorithms.
class_docstr_tok: ["Base","class","for","sklearn","backend","outlier","detection","algorithms","."]
docstr: Infer the threshold for the data. Prerequisite for outlier predictions.
  
  Parameters
  ----------
  x
      Data to infer the threshold for.
  fpr
      False positive rate to use for threshold inference.
  
  Raises
  ------
  ValueError
      Raised if `fpr` is not in ``(0, 1)``.
  ValueError
      Raised if `fpr` is less than ``1/len(x)``.
docstr_tok: ["Infer","the","threshold","for","the","data",".","Prerequisite","for","outlier","predictions",".","Parameters","--","--","--","--","--","x","Data","to","infer","the","threshold","for",".","fpr","False","positive","rate","to","use","for","threshold","inference",".","Raises","--","--","--","ValueError","Raised","if","`","fpr","`","is","not","in","``","(","0",",","1",")","``",".","ValueError","Raised","if","`","fpr","`","is","less","than","``","1\/len","(","x",")","``","."]
code: def infer_threshold(self, x: np.ndarray, fpr: float) -> None:
      """Infer the threshold for the data. Prerequisite for outlier predictions.
  
      Parameters
      ----------
      x
          Data to infer the threshold for.
      fpr
          False positive rate to use for threshold inference.
  
      Raises
      ------
      ValueError
          Raised if `fpr` is not in ``(0, 1)``.
      ValueError
          Raised if `fpr` is less than ``1/len(x)``.
      """
      if not 0 < fpr < 1:
          raise ValueError("`fpr` must be in `(0, 1)`.")
      if fpr < 1 / len(x):
          raise ValueError(
              f"`fpr` must be greater than `1/len(x)={1/len(x)}`."
          )
      self.val_scores = self.score(x)
      self.threshold = np.quantile(self.val_scores, 1 - fpr, interpolation="higher")  # type: ignore[call-overload]
      self.threshold_inferred = True
  
imports: from typing import List, Union, Optional, Dict
  from dataclasses import dataclass, asdict
  from abc import ABC, abstractmethod
  from typing_extensions import Self
  import numpy
  from alibi_detect.exceptions import NotFittedError, ThresholdNotInferredError
label_desc: Use image node_id 7 for calling the SklearnOutlierDetector obj's underlying member method code with example usage: obj.infer_threshold(x, fpr) without return types