code: def _process_distances(X, model):
      """Calculated the mean Cook's distances for
      each feature
  
      Parameters
      ----------
      X : numpy array of shape (n_samples, n_features)
          The training dataset.
  
      model : object
          Regression model used to calculate the Cook's distance
  
      Returns
      -------
      distances_ : numpy array of shape (n_samples)
          mean Cook's distance
      """
  
      distances_ = []
      for i in range(X.shape[1]):
          mod = model
  
          # Extract new X and y inputs
          exp = np.delete(X.copy(), i, axis=1)
          resp = X[:, i]
  
          exp = exp.reshape(-1, 1) if exp.ndim == 1 else exp
  
          # Fit the model
          mod.fit(exp, resp)
  
          # Get Cook's Distance
          distance_ = _Cooks_dist(exp, resp, mod)
  
          distances_.append(distance_)
  
      distances_ = np.nanmean(distances_, axis=0)
  
      return distances_
  
file_path: pyod/pyod/models/cd.py
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  from sklearn.linear_model import LinearRegression
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from .base import BaseDetector
label_desc: Use image node_id 2 for calling a global function with example usage: _process_distances(X, model) and returns: distances_