class_docstr: Loda: Lightweight on-line detector of anomalies. See
  :cite:`pevny2016loda` for more information.
  
  Two versions of LODA are supported:        
  - Static number of bins: uses a static number of bins for all random cuts.
  - Automatic number of bins: every random cut uses a number of bins deemed 
    to be optimal according to the Birge-Rozenblac method
    (:cite:`birge2006many`).
  
  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_bins : int or string, optional (default = 10)
      The number of bins for the histogram. If set to "auto", the 
      Birge-Rozenblac method will be used to automatically determine the 
      optimal number of bins.
  
  n_random_cuts : int, optional (default = 100)
      The number of random cuts.
  
  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: ["Loda",":","Lightweight","on-line","detector","of","anomalies",".","See",":","cite",":","`","pevny2016loda","`","for","more","information",".","Two","versions","of","LODA","are","supported",":","-","Static","number","of","bins",":","uses","a","static","number","of","bins","for","all","random","cuts",".","-","Automatic","number","of","bins",":","every","random","cut","uses","a","number","of","bins","deemed","to","be","optimal","according","to","the","Birge-Rozenblac","method","(",":","cite",":","`","birge2006many","`",")",".","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_bins",":","int","or","string",",","optional","(","default","=","10",")","The","number","of","bins","for","the","histogram",".","If","set","to","``","auto","''",",","the","Birge-Rozenblac","method","will","be","used","to","automatically","determine","the","optimal","number","of","bins",".","n_random_cuts",":","int",",","optional","(","default","=","100",")","The","number","of","random","cuts",".","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_","``","."]
code: def __init__(self, contamination=0.1, n_bins=10, n_random_cuts=100):
      super(LODA, self).__init__(contamination=contamination)
      self.n_bins = n_bins
      self.n_random_cuts = n_random_cuts
      self.weights = np.ones(n_random_cuts, dtype=float) / n_random_cuts
  
file_path: pyod/pyod/models/loda.py
imports: from __future__ import division
  from __future__ import print_function
  import numbers
  import numpy
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from .base import BaseDetector
  from ..utils.utility import get_optimal_n_bins
label_desc: Use image node_id 1 to create a new LODA object from inherited base classes: BaseDetector with example: obj = LODA(contamination, n_bins, n_random_cuts)