class_docstr: Morphs an outlier detection model into a classifier.
  
  When an outlier is detected it will output 1 and 0 otherwise. This way you can use familiar metrics again and
  this allows you to consider outlier models as a fraud detector.
  
  Parameters
  ----------
  model : scikit-learn compatible outlier detection model
      An outlier detection model that will be used for prediction.
  
  Attributes
  ----------
  estimator_ : scikit-learn compatible outlier detection model
      The fitted underlying outlier detection model.
  classes_ : array-like of shape (2,)
      Classes used for prediction (0 or 1)
class_docstr_tok: ["Morphs","an","outlier","detection","model","into","a","classifier",".","When","an","outlier","is","detected","it","will","output","1","and","0","otherwise",".","This","way","you","can","use","familiar","metrics","again","and","this","allows","you","to","consider","outlier","models","as","a","fraud","detector",".","Parameters","--","--","--","--","--","model",":","scikit-learn","compatible","outlier","detection","model","An","outlier","detection","model","that","will","be","used","for","prediction",".","Attributes","--","--","--","--","--","estimator_",":","scikit-learn","compatible","outlier","detection","model","The","fitted","underlying","outlier","detection","model",".","classes_",":","array-like","of","shape","(","2",",",")","Classes","used","for","prediction","(","0","or","1",")"]
docstr: Fit the underlying estimator to the training data `X` and `y`.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Training data.
  y : array-like of shape (n_samples,), default=None
      Target values.
  
  Returns
  -------
  self : OutlierClassifier
      The fitted estimator.
  
  Raises
  ------
  ValueError
      - If the underlying model is not an outlier detection model.
      - If the underlying model does not have a `decision_function` method.
docstr_tok: ["Fit","the","underlying","estimator","to","the","training","data","`","X","`","and","`","y","`",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Training","data",".","y",":","array-like","of","shape","(","n_samples",",",")",",","default=None","Target","values",".","Returns","--","--","--","-","self",":","OutlierClassifier","The","fitted","estimator",".","Raises","--","--","--","ValueError","-","If","the","underlying","model","is","not","an","outlier","detection","model",".","-","If","the","underlying","model","does","not","have","a","`","decision_function","`","method","."]
code: def fit(self, X, y=None):
      """Fit the underlying estimator to the training data `X` and `y`.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          Training data.
      y : array-like of shape (n_samples,), default=None
          Target values.
  
      Returns
      -------
      self : OutlierClassifier
          The fitted estimator.
  
      Raises
      ------
      ValueError
          - If the underlying model is not an outlier detection model.
          - If the underlying model does not have a `decision_function` method.
      """
      X, y = check_X_y(X, y, estimator=self)
      if not self._is_outlier_model():
          raise ValueError("Passed model does not detect outliers!")
      if not hasattr(self.model, "decision_function"):
          raise ValueError(
              f"Passed model {self.model} does not have a `decision_function` "
              f"method. This is required for `predict_proba` estimation."
          )
      self.estimator_ = self.model.fit(X, y)
      self.classes_ = np.array([0, 1])
  
      # fit sigmoid function for `predict_proba`
      decision_function_scores = self.estimator_.decision_function(X)
      self._predict_proba_sigmoid = _SigmoidCalibration().fit(
          decision_function_scores, y
      )
  
      return self
  
file_path: scikit-lego/sklego/meta/outlier_classifier.py
imports: import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.calibration import _SigmoidCalibration
  from sklearn.utils.validation import check_is_fitted, check_X_y
  from sklego.base import OutlierModel
label_desc: Use image node_id 3 for calling the OutlierClassifier obj's underlying member method code with example usage: obj.fit(X, y) and returns: self