class_docstr: Estimates the drift between two datasets
  
      
  Parameters
  ----------
  estimator : classifier, defaut = RandomForestClassifier(n_estimators = 50, n_jobs=-1, max_features=1., min_samples_leaf = 5, max_depth = 5)
      The estimator that estimates the drift between two datasets
      
  n_folds : int, defaut = 2
      Number of folds used to estimate the drift
  
  stratify : bool, defaut = True
      Whether the cv is stratified (same number of train and test samples within each fold)
  
  random_state : int, defaut = 1
      Random state for cv
class_docstr_tok: ["Estimates","the","drift","between","two","datasets","Parameters","--","--","--","--","--","estimator",":","classifier",",","defaut","=","RandomForestClassifier","(","n_estimators","=","50",",","n_jobs=-1",",","max_features=1.",",","min_samples_leaf","=","5",",","max_depth","=","5",")","The","estimator","that","estimates","the","drift","between","two","datasets","n_folds",":","int",",","defaut","=","2","Number","of","folds","used","to","estimate","the","drift","stratify",":","bool",",","defaut","=","True","Whether","the","cv","is","stratified","(","same","number","of","train","and","test","samples","within","each","fold",")","random_state",":","int",",","defaut","=","1","Random","state","for","cv"]
docstr: Computes the drift between the two datasets
  
  Parameters
  ----------
  df_train : pandas dataframe of shape = (n_train, p)
      The train set
  
  df_test : pandas dataframe of shape = (n_test, p)
      The test set
  
  Returns
  -------
  self : object
      Returns self.
docstr_tok: ["Computes","the","drift","between","the","two","datasets","Parameters","--","--","--","--","--","df_train",":","pandas","dataframe","of","shape","=","(","n_train",",","p",")","The","train","set","df_test",":","pandas","dataframe","of","shape","=","(","n_test",",","p",")","The","test","set","Returns","--","--","--","-","self",":","object","Returns","self","."]
code: def fit(self, df_train, df_test):
      """
      Computes the drift between the two datasets
  
      Parameters
      ----------
      df_train : pandas dataframe of shape = (n_train, p)
          The train set
  
      df_test : pandas dataframe of shape = (n_test, p)
          The test set
  
      Returns
      -------
      self : object
          Returns self.
      """
  
      df_train["target"] = 0
      df_test["target"] = 1
  
      self.__target = pd.concat(
          (df_train.target, df_test.target), ignore_index=True
      )
  
      if self.stratify:
          self.__cv = StratifiedKFold(
              n_splits=self.n_folds,
              shuffle=True,
              random_state=self.random_state,
          )
      else:
          self.__cv = KFold(
              n_splits=self.n_folds,
              shuffle=True,
              random_state=self.random_state,
          )
  
      X_tmp = pd.concat((df_train, df_test), ignore_index=True).drop(
          ["target"], axis=1
      )
  
      self.__pred = cross_val_predict(
          estimator=self.estimator,
          X=X_tmp,
          y=self.__target,
          cv=self.__cv,
          method="predict_proba",
      )[:, 1]
  
      del df_train["target"]
      del df_test["target"]
  
      self.__fitOK = True
  
      return self
  
file_path: MLBox/mlbox/preprocessing/drift/drift_estimator.py
imports: import numpy
  import pandas
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.metrics import roc_auc_score
  from sklearn.model_selection import KFold, StratifiedKFold, cross_val_predict
label_desc: Use image node_id 4 for calling the DriftEstimator obj's underlying member method code with example usage: obj.fit(df_train, df_test) and returns: self