class_docstr: Morphs a regression estimator into one that can detect outliers. We will try to predict `column` in X.
  
  Parameters
  ----------
  model : scikit-learn compatible regression model
      A regression model that will be used for prediction.
  column : int
      The index of the target column to predict in the input data.
  lower : float, default=2.0
      Lower threshold for outlier detection. The method used for detection depends on the `method` parameter.
  upper : float, default=2.0
      Upper threshold for outlier detection. The method used for detection depends on the `method` parameter.
  method : Literal["sd", "relative", "absolute"], default="sd"
      The method to use for outlier detection.
  
      - `"sd"` uses standard deviation
      - `"relative"` uses relative difference
      - `"absolute"` uses absolute difference
  
  Attributes
  ----------
  estimator_ : scikit-learn compatible regression model
      The fitted underlying regression model.
  sd_ : float
      The standard deviation of the differences between true and predicted values.
  idx_ : int
      The index of the target column in the input data.
class_docstr_tok: ["Morphs","a","regression","estimator","into","one","that","can","detect","outliers",".","We","will","try","to","predict","`","column","`","in","X.","Parameters","--","--","--","--","--","model",":","scikit-learn","compatible","regression","model","A","regression","model","that","will","be","used","for","prediction",".","column",":","int","The","index","of","the","target","column","to","predict","in","the","input","data",".","lower",":","float",",","default=2.0","Lower","threshold","for","outlier","detection",".","The","method","used","for","detection","depends","on","the","`","method","`","parameter",".","upper",":","float",",","default=2.0","Upper","threshold","for","outlier","detection",".","The","method","used","for","detection","depends","on","the","`","method","`","parameter",".","method",":","Literal","[","``","sd","''",",","``","relative","''",",","``","absolute","''","]",",","default=","''","sd","''","The","method","to","use","for","outlier","detection",".","-","`","``","sd","''","`","uses","standard","deviation","-","`","``","relative","''","`","uses","relative","difference","-","`","``","absolute","''","`","uses","absolute","difference","Attributes","--","--","--","--","--","estimator_",":","scikit-learn","compatible","regression","model","The","fitted","underlying","regression","model",".","sd_",":","float","The","standard","deviation","of","the","differences","between","true","and","predicted","values",".","idx_",":","int","The","index","of","the","target","column","in","the","input","data","."]
docstr: Split `X` into two arrays `X_to_use` and `y`.
  `y` is the column we want to predict (specified in the `column` parameter) and `X_to_use` is the rest of the
  data.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Data to split.
  
  Returns
  -------
  X_to_use : array-like of shape (n_samples, n_features-1)
      Data to use for prediction.
  y : array-like of shape (n_samples,)
      The target column.
docstr_tok: ["Split","`","X","`","into","two","arrays","`","X_to_use","`","and","`","y","`",".","`","y","`","is","the","column","we","want","to","predict","(","specified","in","the","`","column","`","parameter",")","and","`","X_to_use","`","is","the","rest","of","the","data",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Data","to","split",".","Returns","--","--","--","-","X_to_use",":","array-like","of","shape","(","n_samples",",","n_features-1",")","Data","to","use","for","prediction",".","y",":","array-like","of","shape","(","n_samples",",",")","The","target","column","."]
code: def to_x_y(self, X):
      """Split `X` into two arrays `X_to_use` and `y`.
      `y` is the column we want to predict (specified in the `column` parameter) and `X_to_use` is the rest of the
      data.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          Data to split.
  
      Returns
      -------
      X_to_use : array-like of shape (n_samples, n_features-1)
          Data to use for prediction.
      y : array-like of shape (n_samples,)
          The target column.
      """
      y = X[:, self.idx_]
      cols_to_use = [i for i in range(X.shape[1]) if i != self.column]
      X_to_use = X[:, cols_to_use]
      if len(X_to_use.shape) == 1:
          X_to_use = X_to_use.reshape(-1, 1)
      return X_to_use, y
  
file_path: scikit-lego/sklego/meta/regression_outlier_detector.py
imports: import numpy
  import pandas
  from sklearn.base import BaseEstimator, OutlierMixin
  from sklearn.utils.validation import check_array, check_is_fitted
label_desc: Use image node_id 4 for calling the RegressionOutlierDetector obj's underlying member method code with example usage: obj.to_x_y(X) and returns: X_to_use,  y