Package pycv :: Package cs :: Package ml :: Package cla :: Module cla :: Class BinaryErrorStats
[hide private]
[frames] | no frames]

Class BinaryErrorStats

source code

Error statistics for binary classification.

Nested Classes [hide private]
  InfeasibleSolution
InfeasibleSolution
Instance Methods [hide private]
 
__init__(self, err_array=array([ 0., 0., 0., 0.]))
Initialize the class.
source code
 
objective(criterion=0, param1=1)
Get the objective function value.
source code
Method Details [hide private]

__init__(self, err_array=array([ 0., 0., 0., 0.]))
(Constructor)

source code 
Initialize the class.
Parameters:
  • err_array (array of 5 doubles) - err_array[0] : FAR err_array[1] : FRR err_array[2] : total weight of class 0 err_array[3] : total weight of class 1

objective(criterion=0, param1=1)

source code 

Get the objective function value.

There are four different criteria to consider:
  • Minimize the error rate: lambda * p(pos)*FRR + p(neg)*FAR
  • Minimize the error rate without prior: lambda * FRR + FAR
  • Minimize FAR with constraint FRR <= maxFRR
  • Minimize FRR with constraint FAR <= maxFAR
Parameters:
  • criterion (integer from 0 to 3) - 0: minimize the error rate with prior probabilities 1: minimize the error rate without prior probabilities 2: minimize FAR while constraining FRR 3: minimize FRR while constraining FAR
  • param1 (double) -
    a parameter representing
    lambda if criterion < 2 maxFRR if criterion == 2 maxFAR if criterion == 3
Returns:
objective function value based on the given criterion An InfeasibleSolution exception is raised if necessary