class_docstr: Single-Objective Generative Adversarial Active Learning.
  
  SO-GAAL directly generates informative potential outliers to assist the
  classifier in describing a boundary that can separate outliers from normal
  data effectively. Moreover, to prevent the generator from falling into the
  mode collapsing problem, the network structure of SO-GAAL is expanded from
  a single generator (SO-GAAL) to multiple generators with different
  objectives (MO-GAAL) to generate a reasonable reference distribution for
  the whole dataset.
  Read more in the :cite:`liu2019generative`.
  
  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.
  
  stop_epochs : int, optional (default=20)
      The number of epochs of training. The number of total epochs equals to three times of stop_epochs.
  
  lr_d : float, optional (default=0.01)
      The learn rate of the discriminator.
  
  lr_g : float, optional (default=0.0001)
      The learn rate of the generator.
  
  momentum : float, optional (default=0.9)
      The momentum parameter for SGD.
  
  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: ["Single-Objective","Generative","Adversarial","Active","Learning",".","SO-GAAL","directly","generates","informative","potential","outliers","to","assist","the","classifier","in","describing","a","boundary","that","can","separate","outliers","from","normal","data","effectively",".","Moreover",",","to","prevent","the","generator","from","falling","into","the","mode","collapsing","problem",",","the","network","structure","of","SO-GAAL","is","expanded","from","a","single","generator","(","SO-GAAL",")","to","multiple","generators","with","different","objectives","(","MO-GAAL",")","to","generate","a","reasonable","reference","distribution","for","the","whole","dataset",".","Read","more","in","the",":","cite",":","`","liu2019generative","`",".","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",".","stop_epochs",":","int",",","optional","(","default=20",")","The","number","of","epochs","of","training",".","The","number","of","total","epochs","equals","to","three","times","of","stop_epochs",".","lr_d",":","float",",","optional","(","default=0.01",")","The","learn","rate","of","the","discriminator",".","lr_g",":","float",",","optional","(","default=0.0001",")","The","learn","rate","of","the","generator",".","momentum",":","float",",","optional","(","default=0.9",")","The","momentum","parameter","for","SGD",".","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.
  
  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. 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",".","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",".","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(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. 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.
      """
      check_is_fitted(self, ["discriminator"])
      X = check_array(X)
      pred_scores = self.discriminator.predict(X).ravel()
      return pred_scores
  
file_path: pyod/pyod/models/so_gaal.py
imports: from __future__ import division
  from __future__ import print_function
  from collections import defaultdict
  import numpy
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from .base import BaseDetector
  from .base_dl import _get_tensorflow_version
  from .gaal_base import create_discriminator
  from .gaal_base import create_generator
label_desc: Use image node_id 3 for calling the SO_GAAL obj's underlying member method code with example usage: obj.decision_function(X) and returns: pred_scores