class_docstr: Local Correlation Integral.
  
  LOCI is highly effective for detecting outliers and groups of 
  outliers ( a.k.a.micro-clusters), which offers the following advantages 
  and novelties: (a) It provides an automatic, data-dictated cut-off to 
  determine whether a point is an outlier—in contrast, previous methods 
  force users to pick cut-offs, without any hints as to what cut-off value 
  is best for a given dataset. (b) It can provide a LOCI plot for each 
  point; this plot summarizes a wealth of information about the data in 
  the vicinity of the point, determining clusters, micro-clusters, their 
  diameters and their inter-cluster distances. None of the existing 
  outlier-detection methods can match this feature, because they output 
  only a single number for each point: its outlierness score.(c) It can 
  be computed as quickly as the best previous methods
  Read more in the :cite:`papadimitriou2003loci`.
  
  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.
  
  alpha : int, default = 0.5
      The neighbourhood parameter measures how large of a neighbourhood
      should be considered "local".
  
  k: int, default = 3
      An outlier cutoff threshold for determine whether or not a point 
      should be considered an outlier.
  
  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_``.
  
  Examples
  --------
  >>> from pyod.models.loci import LOCI
  >>> from pyod.utils.data import generate_data
  >>> n_train = 50
  >>> n_test = 50
  >>> contamination = 0.1
  >>> X_train, y_train, X_test, y_test = generate_data(
  ...     n_train=n_train, n_test=n_test,
  ...     contamination=contamination, random_state=42)
  >>> clf = LOCI()
  >>> clf.fit(X_train)
  LOCI(alpha=0.5, contamination=0.1, k=None)
class_docstr_tok: ["Local","Correlation","Integral",".","LOCI","is","highly","effective","for","detecting","outliers","and","groups","of","outliers","(","a.k.a.micro-clusters",")",",","which","offers","the","following","advantages","and","novelties",":","(","a",")","It","provides","an","automatic",",","data-dictated","cut-off","to","determine","whether","a","point","is","an","outlier\u2014in","contrast",",","previous","methods","force","users","to","pick","cut-offs",",","without","any","hints","as","to","what","cut-off","value","is","best","for","a","given","dataset",".","(","b",")","It","can","provide","a","LOCI","plot","for","each","point",";","this","plot","summarizes","a","wealth","of","information","about","the","data","in","the","vicinity","of","the","point",",","determining","clusters",",","micro-clusters",",","their","diameters","and","their","inter-cluster","distances",".","None","of","the","existing","outlier-detection","methods","can","match","this","feature",",","because","they","output","only","a","single","number","for","each","point",":","its","outlierness","score",".","(","c",")","It","can","be","computed","as","quickly","as","the","best","previous","methods","Read","more","in","the",":","cite",":","`","papadimitriou2003loci","`",".","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",".","alpha",":","int",",","default","=","0.5","The","neighbourhood","parameter","measures","how","large","of","a","neighbourhood","should","be","considered","``","local","''",".","k",":","int",",","default","=","3","An","outlier","cutoff","threshold","for","determine","whether","or","not","a","point","should","be","considered","an","outlier",".","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_","``",".","Examples","--","--","--","--",">",">",">","from","pyod.models.loci","import","LOCI",">",">",">","from","pyod.utils.data","import","generate_data",">",">",">","n_train","=","50",">",">",">","n_test","=","50",">",">",">","contamination","=","0.1",">",">",">","X_train",",","y_train",",","X_test",",","y_test","=","generate_data","(","...","n_train=n_train",",","n_test=n_test",",","...","contamination=contamination",",","random_state=42",")",">",">",">","clf","=","LOCI","(",")",">",">",">","clf.fit","(","X_train",")","LOCI","(","alpha=0.5",",","contamination=0.1",",","k=None",")"]
code: def decision_function(self, X):
      check_is_fitted(
          self, ["decision_scores_", "threshold_", "labels_"]
      )
      X = check_array(X)
      return self._calculate_decision_score(X)
  
file_path: pyod/pyod/models/loci.py
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  from numba import njit
  from scipy.spatial.distance import pdist, squareform
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from .base import BaseDetector
label_desc: Use image node_id 5 for calling the LOCI obj's underlying member method code with example usage: obj.decision_function(X) and returns: self