Package pycv :: Package cs :: Package stats :: Package gaussian :: Module gaussian
[hide private]
[frames] | no frames]

Module gaussian

source code

Functions [hide private]
 
find_classification_threshold(stats2e, thelambda=1.0)
Compute the estimated error.
source code
 
find_filtering_threshold(stats2e, minDR=0.002)
Use the thresholded classifier as above.
source code
 
find_filtering_threshold2(stats2e, maxFAR=0.002)
Use the thresholded classifier as above.
source code
 
main() source code
Function Details [hide private]

find_classification_threshold(stats2e, thelambda=1.0)

source code 

Compute the estimated error. Here we penalize false negative by sqrt(thelambda) and false positive by 1/sqrt(thelambda).

Input:

stats2e: per-element statistics of 2*N classes thelambda: the value of 'lambda'

Output:
b: a numpy.array of shape (N,2) to hold the results where
b[i][0]: a threshold minimizing w.r.t. b
f(b) = (1/sqrt(thelambda) * w[i*2] * sf((b-mu[i*2])/sigma[i*2]) +

sqrt(thelambda) * w[i*2+1] * cdf((b-mu[i*2+1])/sigma[i*2+1])) / (w[i*2]+w[i*2+1])

where sf(.) and cdf(.) are w.r.t. the normalized gaussian distribution b[i][1] = f(b[i][0]), the estimated error

Requirement:

mu[i*2] <= mu[i*2+1] for all i = 0..N-1

find_filtering_threshold(stats2e, minDR=0.002)

source code 

Use the thresholded classifier as above. If we wish detection rate >= minDR, what is the largest threshold?

Input:

stats2e: per-element statistics of 2*N classes minDR: the value of 'minDR'

Output:
b: a numpy.array of shape (N,2) to hold the results where
b[i][0]: a threshold that

minimize FAR(b) = sf((b-mu[i*2])/sigma[i*2]) w.r.t. b subject to DR(b) = sf((b-mu[i*2+1])/sigma[i*2+1]) >= minDR

where sf(.) is w.r.t. the normalized gaussian distribution b[i][1] = FAR(b[i][0]), the estimated false acceptance rate

Requirement:

mu[i*2] <= mu[i*2+1] for all i = 0..N-1

find_filtering_threshold2(stats2e, maxFAR=0.002)

source code 

Use the thresholded classifier as above. If we wish false acceptance rate <= maxFAR, what is the smallest threshold?

Input:

stats2e: per-element statistics of 2*N classes maxFAR: the value of 'maxFAR'

Output:
b: a numpy.array of shape (N,2) to hold the results where
b[i][0]: a threshold that

maximize DR(b) = sf((b-mu[i*2+1])/sigma[i*2+1]) w.r.t. b subject to FAR(b) = sf((b-mu[i*2])/sigma[i*2]) <= maxFAR

where sf(.) is w.r.t. the normalized gaussian distribution b[i][1] = 1-DR(b[i][0]), the estimated false rejection rate

Requirement:

mu[i*2] <= mu[i*2+1] for all i = 0..N-1