class_docstr: Isolation-based anomaly detection using nearest-neighbor ensembles.
  
  The INNE algorithm uses the nearest neighbour ensemble to isolate
  anomalies. It partitions the data space into regions using a subsample and
  determines an isolation score for each region. As each region adapts to
  local distribution, the calculated isolation score is a local measure that
  is relative to the local neighbourhood, enabling it to detect both global
  and local anomalies. INNE has linear time complexity to efficiently handle
  large and high-dimensional datasets with complex distributions.
  
  See :cite:`bandaragoda2018isolation` for details.
  
  Parameters
  ----------
  n_estimators : int, default=200
      The number of base estimators in the ensemble.
  
  max_samples : int or float, optional (default="auto")
      The number of samples to draw from X to train each base estimator.
  
          - If int, then draw `max_samples` samples.
          - If float, then draw `max_samples` * X.shape[0]` samples.
          - If "auto", then `max_samples=min(8, n_samples)`.
  
  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.
  
  random_state : int, RandomState instance or None, optional (default=None)
      If int, random_state is the seed used by the random number generator;
      If RandomState instance, random_state is the random number generator;
      If None, the random number generator is the RandomState instance used
      by `np.random`.
  
  Attributes
  ----------
  max_samples_ : integer
      The actual number of samples
  
  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: ["Isolation-based","anomaly","detection","using","nearest-neighbor","ensembles",".","The","INNE","algorithm","uses","the","nearest","neighbour","ensemble","to","isolate","anomalies",".","It","partitions","the","data","space","into","regions","using","a","subsample","and","determines","an","isolation","score","for","each","region",".","As","each","region","adapts","to","local","distribution",",","the","calculated","isolation","score","is","a","local","measure","that","is","relative","to","the","local","neighbourhood",",","enabling","it","to","detect","both","global","and","local","anomalies",".","INNE","has","linear","time","complexity","to","efficiently","handle","large","and","high-dimensional","datasets","with","complex","distributions",".","See",":","cite",":","`","bandaragoda2018isolation","`","for","details",".","Parameters","--","--","--","--","--","n_estimators",":","int",",","default=200","The","number","of","base","estimators","in","the","ensemble",".","max_samples",":","int","or","float",",","optional","(","default=","''","auto","''",")","The","number","of","samples","to","draw","from","X","to","train","each","base","estimator",".","-","If","int",",","then","draw","`","max_samples","`","samples",".","-","If","float",",","then","draw","`","max_samples","`","*","X.shape","[","0","]","`","samples",".","-","If","``","auto","''",",","then","`","max_samples=min","(","8",",","n_samples",")","`",".","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",".","random_state",":","int",",","RandomState","instance","or","None",",","optional","(","default=None",")","If","int",",","random_state","is","the","seed","used","by","the","random","number","generator",";","If","RandomState","instance",",","random_state","is","the","random","number","generator",";","If","None",",","the","random","number","generator","is","the","RandomState","instance","used","by","`","np.random","`",".","Attributes","--","--","--","--","--","max_samples_",":","integer","The","actual","number","of","samples","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.
  
  The anomaly score of an input sample is computed based on different
  detector algorithms. For consistency, outliers are assigned with
  larger anomaly scores.
  
  Parameters
  ----------
  X : numpy array of shape (n_samples, n_features)
      The training input samples. 
  
  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",".","The","anomaly","score","of","an","input","sample","is","computed","based","on","different","detector","algorithms",".","For","consistency",",","outliers","are","assigned","with","larger","anomaly","scores",".","Parameters","--","--","--","--","--","X",":","numpy","array","of","shape","(","n_samples",",","n_features",")","The","training","input","samples",".","Returns","--","--","--","-","anomaly_scores",":","numpy","array","of","shape","(","n_samples",",",")","The","anomaly","score","of","the","input","samples","."]
code: def decision_function(self, X):
      """Predict raw anomaly score of X using the fitted detector.
  
      The anomaly score of an input sample is computed based on different
      detector algorithms. For consistency, outliers are assigned with
      larger anomaly scores.
  
      Parameters
      ----------
      X : numpy array of shape (n_samples, n_features)
          The training input samples.
  
      Returns
      -------
      anomaly_scores : numpy array of shape (n_samples,)
          The anomaly score of the input samples.
      """
      check_is_fitted(
          self, ["decision_scores_", "threshold_", "labels_"]
      )
      # invert outlier scores. Outliers comes with higher outlier scores
      return invert_order(self._score_samples(X))
  
file_path: pyod/pyod/models/inne.py
imports: from __future__ import division
  from __future__ import print_function
  import numbers
  from warnings import warn
  import numpy
  from sklearn.metrics import euclidean_distances
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted, check_random_state
  from .base import BaseDetector
  from ..utils.utility import MAX_INT, invert_order
label_desc: Use image node_id 4 for calling the INNE obj's underlying member method code with example usage: obj.decision_function(X) and returns: invert_order