class_docstr: Subspace outlier detection (SOD) schema aims to detect outlier in
  varying subspaces of a high dimensional feature space. For each data
  object, SOD explores the axis-parallel subspace spanned by the data
  object's neighbors and determines how much the object deviates from the
  neighbors in this subspace.
  
  See :cite:`kriegel2009outlier` for details.
  
  Parameters
  ----------
  n_neighbors : int, optional (default=20)
      Number of neighbors to use by default for k neighbors queries.
  
  ref_set: int, optional (default=10)
      specifies the number of shared nearest neighbors to create the
      reference set. Note that ref_set must be smaller than n_neighbors.
  
  alpha: float in (0., 1.), optional (default=0.8)
         specifies the lower limit for selecting subspace.
         0.8 is set as default as suggested in the original paper.
  
  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.
  
  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: This function is called internally to calculate the shared nearest
  neighbors (SNN). SNN is reported to be more robust than k nearest
  neighbors.
  
  Returns
  -------
  snn_indices : numpy array of shape (n_shared_nearest_neighbors,)
      The indices of top k shared nearest neighbors for each observation.
docstr_tok: ["This","function","is","called","internally","to","calculate","the","shared","nearest","neighbors","(","SNN",")",".","SNN","is","reported","to","be","more","robust","than","k","nearest","neighbors",".","Returns","--","--","--","-","snn_indices",":","numpy","array","of","shape","(","n_shared_nearest_neighbors",",",")","The","indices","of","top","k","shared","nearest","neighbors","for","each","observation","."]
code: def _snn(self, X):
      """This function is called internally to calculate the shared nearest
      neighbors (SNN). SNN is reported to be more robust than k nearest
      neighbors.
  
      Returns
      -------
      snn_indices : numpy array of shape (n_shared_nearest_neighbors,)
          The indices of top k shared nearest neighbors for each observation.
      """
      knn = NearestNeighbors(n_neighbors=self.n_neighbors)
      knn.fit(X)
      # Get the knn index
      ind = knn.kneighbors(return_distance=False)
      return _snn_imp(ind, self.ref_set)
  
file_path: pyod/pyod/models/sod.py
imports: import numba
  import numpy
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import check_array
  from .base import BaseDetector
  from ..utils.utility import check_parameter
label_desc: Use image node_id 4 for calling the SOD obj's underlying member method code with example usage: obj._snn(X) and returns: _snn_imp