class_docstr: COPOD class for Copula Based Outlier Detector.
  COPOD is a parameter-free, highly interpretable outlier detection algorithm
  based on empirical copula models.
  See :cite:`li2020copod` for details.
  
  Parameters
  ----------
  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
      number of cores.
  
  Attributes
  ----------
  decision_scores_ : numpy array of shape (n_samples,)
      The outlier scores of the training data.
      The higher, the more abnormal. Outliers tend to have higher
      scores. This value is available once the detector is
      fitted.
  threshold_ : float
      The threshold is based on ``contamination``. It is the
      ``n_samples * contamination`` most abnormal samples in
      ``decision_scores_``. The threshold is calculated for generating
      binary outlier labels.
  labels_ : int, either 0 or 1
      The binary labels of the training data. 0 stands for inliers
      and 1 for outliers/anomalies. It is generated by applying
      ``threshold_`` on ``decision_scores_``.
class_docstr_tok: ["COPOD","class","for","Copula","Based","Outlier","Detector",".","COPOD","is","a","parameter-free",",","highly","interpretable","outlier","detection","algorithm","based","on","empirical","copula","models",".","See",":","cite",":","`","li2020copod","`","for","details",".","Parameters","--","--","--","--","--","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","number","of","cores",".","Attributes","--","--","--","--","--","decision_scores_",":","numpy","array","of","shape","(","n_samples",",",")","The","outlier","scores","of","the","training","data",".","The","higher",",","the","more","abnormal",".","Outliers","tend","to","have","higher","scores",".","This","value","is","available","once","the","detector","is","fitted",".","threshold_",":","float","The","threshold","is","based","on","``","contamination","``",".","It","is","the","``","n_samples","*","contamination","``","most","abnormal","samples","in","``","decision_scores_","``",".","The","threshold","is","calculated","for","generating","binary","outlier","labels",".","labels_",":","int",",","either","0","or","1","The","binary","labels","of","the","training","data",".","0","stands","for","inliers","and","1","for","outliers\/anomalies",".","It","is","generated","by","applying","``","threshold_","``","on","``","decision_scores_","``","."]
docstr: Predict raw anomaly score of X using the fitted detector.
   For consistency, outliers are assigned with larger anomaly scores.
  Parameters
  ----------
  X : numpy array of shape (n_samples, n_features)
      The training input samples. Sparse matrices are accepted only
      if they are supported by the base estimator.
  Returns
  -------
  anomaly_scores : numpy array of shape (n_samples,)
      The anomaly score of the input samples.
docstr_tok: ["Predict","raw","anomaly","score","of","X","using","the","fitted","detector",".","For","consistency",",","outliers","are","assigned","with","larger","anomaly","scores",".","Parameters","--","--","--","--","--","X",":","numpy","array","of","shape","(","n_samples",",","n_features",")","The","training","input","samples",".","Sparse","matrices","are","accepted","only","if","they","are","supported","by","the","base","estimator",".","Returns","--","--","--","-","anomaly_scores",":","numpy","array","of","shape","(","n_samples",",",")","The","anomaly","score","of","the","input","samples","."]
code: def _decision_function_parallel(self, X):
      """Predict raw anomaly score of X using the fitted detector.
       For consistency, outliers are assigned with larger anomaly scores.
      Parameters
      ----------
      X : numpy array of shape (n_samples, n_features)
          The training input samples. Sparse matrices are accepted only
          if they are supported by the base estimator.
      Returns
      -------
      anomaly_scores : numpy array of shape (n_samples,)
          The anomaly score of the input samples.
      """
      if hasattr(self, "X_train"):
          original_size = X.shape[0]
          X = np.concatenate((self.X_train, X), axis=0)
  
      n_samples, n_features = X.shape[0], X.shape[1]
  
      if n_features < 2:
          raise ValueError(
              "n_jobs should not be used on one dimensional dataset"
          )
  
      if n_features <= self.n_jobs:
          self.n_jobs = n_features
          warnings.warn(
              "n_features <= n_jobs; setting them equal instead."
          )
  
      n_jobs, n_dims_list, starts = _partition_estimators(
          n_features, self.n_jobs
      )
  
      all_results = Parallel(
          n_jobs=n_jobs, max_nbytes=None, verbose=True
      )(
          delayed(_parallel_ecdf)(
              n_dims_list[i],
              X[:, starts[i] : starts[i + 1]],
          )
          for i in range(n_jobs)
      )
  
      # recover the results
      self.U_l = np.zeros([n_samples, n_features])
      self.U_r = np.zeros([n_samples, n_features])
  
      for i in range(n_jobs):
          self.U_l[:, starts[i] : starts[i + 1]] = all_results[i][0]
          self.U_r[:, starts[i] : starts[i + 1]] = all_results[i][1]
  
      self.U_l = -1 * np.log(self.U_l)
      self.U_r = -1 * np.log(self.U_r)
  
      skewness = np.sign(skew(X, axis=0))
      self.U_skew = self.U_l * -1 * np.sign(
          skewness - 1
      ) + self.U_r * np.sign(skewness + 1)
      self.O = np.maximum(self.U_skew, np.add(self.U_l, self.U_r) / 2)
      if hasattr(self, "X_train"):
          decision_scores_ = self.O.sum(axis=1)[-original_size:]
      else:
          decision_scores_ = self.O.sum(axis=1)
      return decision_scores_.ravel()
  
file_path: pyod/pyod/models/copod.py
imports: from __future__ import division
  from __future__ import print_function
  import warnings
  import matplotlib.pyplot
  import numpy
  from joblib import Parallel, delayed
  from scipy.stats import skew
  from sklearn.utils import check_array
  from .base import BaseDetector
  from .sklearn_base import _partition_estimators
  from ..utils.stat_models import column_ecdf
label_desc: Use image node_id 4 for calling the COPOD obj's underlying member method code with example usage: obj._decision_function_parallel(X) and returns: decision_scores_