Package classifiers :: Module sim_cen_gauss_class
[frames] | no frames]

Module sim_cen_gauss_class

source code

Simple centered Gaussian Classifier. It's designed for a case where there is a lot of data and where the data is a multivariate Gaussian.

Functions
float
logdet(cov)
Returns: the log of the determinant of a matrix.
source code
float
typ_trace(covlist)
This is used with boost_diag().
source code
 
boost_diag(covlist, diagboost)
This raises all the eigenvalues a little bit, so that processing can proceed even if the covariance is singular.
source code
 
go_auto(fd, Mu=False, coverage=3, ftest=0.25, cb=None, cfd_file=None) source code
 
n_zero_cov_builder(d, N, modelchoice=None, trainingset_name=None, diagboost=1e-06) source code
 
n_zero_cov_builder_drop(d, N, modelchoice=None, trainingset_name=None, diagboost=1e-06)
Needs to return a list, not an iterator.
source code
 
n_mu_cov_builder(d, N, modelchoice=None, trainingset_name=None, diagboost=1e-06) source code
 
test1() source code
Variables
  COVERAGE = 3
  FTEST = 0.25
  Fudge = 1e-06
  PSYCO = False
  __package__ = 'classifiers'

Imports: die, Num, dictops, fiatio, gpk_writer, QCR


Function Details

logdet(cov)

source code 
Parameters:
  • cov (numpy.ndarray) - a 2-dimensional matrix
Returns: float
the log of the determinant of a matrix.

typ_trace(covlist)

source code 

This is used with boost_diag(). It returns a typical value for the the trace of the covariance matrix, averaged over all matrices.

Parameters:
  • covlist (dict(str:numpy.ndarray)) - a dictionary mapping names to covariance matrices.
Returns: float
trace of covariance

boost_diag(covlist, diagboost)

source code 

This raises all the eigenvalues a little bit, so that processing can proceed even if the covariance is singular. To first order, the fudge gets subtracted later on in the processing.

Parameters:
  • covlist (dict(str:numpy.ndarray)) - a dictionary mapping names to covariance matrices.
  • diagboost (float) - how much to boost

go_auto(fd, Mu=False, coverage=3, ftest=0.25, cb=None, cfd_file=None)

source code 
Parameters:
  • cb (list(QCR.classifier)) - a function that builds the classifier. E.g. n_zero_cov_builder.
  • Mu (bool) - should the class means be allowed to be nonzero? Not here; Mu must be false.
  • cfd_file (str) - Pathname where the definition of the classifier should be written. None => don't write.