class_docstr: SUOD (Scalable Unsupervised Outlier Detection) is an acceleration
  framework for large scale unsupervised outlier detector training and
  prediction. The corresponding paper is under review in KDD 2020.
  
  Parameters
  ----------
  base_estimators: list, length must be greater than 1
          A list of base estimators. Certain methods must be present, e.g.,
          `fit` and `predict`.
  
  contamination : float in (0., 0.5), optional (default=0.1)
          The amount of contamination of the data set,
          i.e. the proportion of outliers in the data set. Used when fitting to
          define the threshold on the decision function.
  
  n_jobs : optional (default=1)
          The number of jobs to run in parallel for both `fit` and
          `predict`. If -1, then the number of jobs is set to the
          the number of jobs that can actually run in parallel.
  
  rp_clf_list : list, optional (default=None)
          The list of outlier detection models to use random projection. The
          detector name should be consistent with PyOD.
  
  rp_ng_clf_list : list, optional (default=None)
          The list of outlier detection models NOT to use random projection. The
          detector name should be consistent with PyOD.
  
  rp_flag_global : bool, optional (default=True)
          If set to False, random projection is turned off for all base models.
  
  target_dim_frac : float in (0., 1), optional (default=0.5)
          The target compression ratio.
  
  jl_method : string, optional (default = 'basic')
          The JL projection method:
  
          - "basic": each component of the transformation matrix is taken at
            random in N(0,1).
          - "discrete", each component of the transformation matrix is taken at
            random in {-1,1}.
          - "circulant": the first row of the transformation matrix is taken at
            random in N(0,1), and each row is obtained from the previous one
            by a one-left shift.
          - "toeplitz": the first row and column of the transformation matrix
            is taken at random in N(0,1), and each diagonal has a constant value
            taken from these first vector.
  
  bps_flag : bool, optional (default=True)
          If set to False, balanced parallel scheduling is turned off.
  
  approx_clf_list : list, optional (default=None)
          The list of outlier detection models to use pseudo-supervised
          approximation. The detector name should be consistent with PyOD.
  
  approx_ng_clf_list : list, optional (default=None)
          The list of outlier detection models NOT to use pseudo-supervised
          approximation. The detector name should be consistent with PyOD.
  
  approx_flag_global : bool, optional (default=True)
          If set to False, pseudo-supervised approximation is turned off.
  
  approx_clf : object, optional (default: sklearn RandomForestRegressor)
          The supervised model used to approximate unsupervised models.
  
  cost_forecast_loc_fit : str, optional
          The location of the pretrained cost prediction forecast for training.
  
  cost_forecast_loc_pred : str, optional
          The location of the pretrained cost prediction forecast for prediction.
  
  verbose : bool, optional (default=False)
          Controls the verbosity of the building process.
docstr: Fit all base estimators.
  
  Parameters
  ----------
  X : numpy array of shape (n_samples, n_features)
          The input samples.
  
  Returns
  -------
  self : object
          Fitted estimator.
docstr_tok: ["Fit","all","base","estimators",".","Parameters","--","--","--","--","--","X",":","numpy","array","of","shape","(","n_samples",",","n_features",")","The","input","samples",".","Returns","--","--","--","-","self",":","object","Fitted","estimator","."]
code: def fit(self, X):
      """Fit all base estimators.
  
      Parameters
      ----------
      X : numpy array of shape (n_samples, n_features)
              The input samples.
  
      Returns
      -------
      self : object
              Fitted estimator.
      """
      X = check_array(X)
      n_samples, n_features = X.shape[0], X.shape[1]
  
      # Validate target_dim_frac for random projection
      if isinstance(
          self.target_dim_frac, (numbers.Integral, np.integer)
      ):
          self.target_dim_frac_ = self.target_dim_frac
      else:  # float
          self.target_dim_frac_ = int(self.target_dim_frac * n_features)
  
      # it should have at least 1 dimension
      if self.target_dim_frac_ < 1:
          self.target_dim_frac_ = 1
  
      # build flags for random projection
      self.rp_flags_, _ = build_codes(
          self.base_estimators,
          self.rp_clf_list,
          self.rp_ng_clf_list,
          self.rp_flag_global,
      )
  
      # decide whether bps is needed
      # it is turned off
      if self.bps_flag:
          # load the pre-trained cost predictor to forecast the train cost
          cost_predictor = load_predictor_train(
              self.cost_forecast_loc_fit
          )
  
          print(cost_predictor)
          time_cost_pred = cost_forecast_meta(
              cost_predictor, X, self.base_estimator_names
          )
  
          # use BPS
          n_estimators_list, starts, n_jobs = balanced_scheduling(
              time_cost_pred,
              self.n_estimators,
              self.n_jobs,
              self.verbose,
          )
      else:
          # use the default sklearn equal split
          n_estimators_list, starts, n_jobs = _partition_estimators(
              self.n_estimators, self.n_jobs, verbose=self.verbose
          )
  
      # fit the base models
      # fit the base models
      if self.verbose:
          print("Parallel Training...")
          start = time.time()
  
      # TODO: code cleanup. There is an existing bug for joblib on Windows:
      # https://github.com/joblib/joblib/issues/806
      # a fix is on the way: https://github.com/joblib/joblib/pull/966
      # max_nbytes can be dropped on other OS
      all_results = Parallel(
          n_jobs=n_jobs, max_nbytes=None, verbose=True
      )(
          delayed(_parallel_fit)(
              n_estimators_list[i],
              self.base_estimators[starts[i] : starts[i + 1]],
              X,
              self.n_estimators,
              self.rp_flags[starts[i] : starts[i + 1]],
              self.target_dim_frac_,
              self.jl_method,
              verbose=self.verbose,
          )
          for i in range(n_jobs)
      )
  
      if self.verbose:
          print(
              "Balanced Scheduling Total Train Time:",
              time.time() - start,
          )
  
      # reformat and unfold the lists. Save the trained estimators and
      # transformers
      all_results = list(map(list, zip(*all_results)))
  
      # overwrite estimators
      self.base_estimators = _unfold_parallel(all_results[0], n_jobs)
      self.jl_transformers_ = _unfold_parallel(all_results[1], n_jobs)
  
      return self
  
imports: import os
  import sys
  import time
  import numbers
  import numpy
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.utils import check_array
  import joblib
  from joblib import Parallel, delayed, effective_n_jobs
  from joblib.externals.loky.backend.context import set_start_method
  from pyod.models.sklearn_base import _pprint
  from pyod.utils.utility import check_parameter
  from suod.models.parallel_processes import cost_forecast_meta
  from suod.models.parallel_processes import balanced_scheduling
  from suod.models.parallel_processes import _parallel_fit
  from suod.models.parallel_processes import _parallel_predict
  from suod.models.parallel_processes import _parallel_predict_proba
  from suod.models.parallel_processes import _parallel_decision_function
  from suod.models.parallel_processes import _partition_estimators
  from suod.models.parallel_processes import _parallel_approx_estimators
  from ..utils.utility import _unfold_parallel, build_codes, _get_sklearn_version
  import warnings
  from collections import defaultdict
  from inspect import signature
label_desc: Use image node_id 3 for calling the SUOD obj's underlying member method code with example usage: obj.fit(X) and returns: self