Public Member Functions | Private Attributes | List of all members
learn_lib.output_matrix.OutputMatrix Class Reference
Inheritance diagram for learn_lib.output_matrix.OutputMatrix:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self)
 
def get_accuracy (self)
 
def get_f1measure (self)
 
def get_measures (self)
 
def get_precision (self)
 
def get_recall (self)
 
def output_matrix (self, true_y, pred_y)
 
def set_accuracy (self)
 
def set_confusion_matrix (self, tp, fp, tn, fn)
 
def set_f1measure (self)
 
def set_measures (self)
 
def set_precision (self)
 
def set_recall (self)
 

Private Attributes

 __acc
 
 __f1
 
 __fn
 
 __fp
 
 __prec
 
 __rec
 
 __tn
 
 __tp
 

Detailed Description

Definition at line 19 of file output_matrix.py.

Constructor & Destructor Documentation

def learn_lib.output_matrix.OutputMatrix.__init__ (   self)

Definition at line 21 of file output_matrix.py.

Member Function Documentation

def learn_lib.output_matrix.OutputMatrix.get_accuracy (   self)

Definition at line 79 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.get_f1measure (   self)

Definition at line 91 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.get_measures (   self)
        Measures are printed and returned.

Definition at line 61 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.get_precision (   self)

Definition at line 87 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.get_recall (   self)

Definition at line 83 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.output_matrix (   self,
  true_y,
  pred_y 
)
Output matrix
        Meant to print the output confusion matrix. Specifically
- True Positive
- False Positive
- True Negative
- False Negative

The above gets printed for both the training data and testing data.

Definition at line 139 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.set_accuracy (   self)
        acc = (tp + fp) / (tp + fp + tn + fn)

Definition at line 95 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.set_confusion_matrix (   self,
  tp,
  fp,
  tn,
  fn 
)
        First to be called.
        Sets the confusion matrix values.

Definition at line 32 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.set_f1measure (   self)
        f1 = (2 * rec * prec) / (rec + prec)

        Balanced F1 score that is the harmonic mean of both recall
and precision.

Definition at line 127 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.set_measures (   self)
        Before measuers are set, make sure confusion matrix
exists, or else exit.

Definition at line 44 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.set_precision (   self)
        prec = tp / (tp + fp)

Definition at line 116 of file output_matrix.py.

def learn_lib.output_matrix.OutputMatrix.set_recall (   self)
        rec = tp / (tp + fn)

Definition at line 105 of file output_matrix.py.

Member Data Documentation

learn_lib.output_matrix.OutputMatrix.__acc
private

Definition at line 26 of file output_matrix.py.

learn_lib.output_matrix.OutputMatrix.__f1
private

Definition at line 29 of file output_matrix.py.

learn_lib.output_matrix.OutputMatrix.__fn
private

Definition at line 25 of file output_matrix.py.

learn_lib.output_matrix.OutputMatrix.__fp
private

Definition at line 23 of file output_matrix.py.

learn_lib.output_matrix.OutputMatrix.__prec
private

Definition at line 28 of file output_matrix.py.

learn_lib.output_matrix.OutputMatrix.__rec
private

Definition at line 27 of file output_matrix.py.

learn_lib.output_matrix.OutputMatrix.__tn
private

Definition at line 24 of file output_matrix.py.

learn_lib.output_matrix.OutputMatrix.__tp
private

Definition at line 22 of file output_matrix.py.


The documentation for this class was generated from the following file:


mh5_anomaly_detector
Author(s): Vedanth Narayanan
autogenerated on Mon Jun 10 2019 13:49:20