Package src :: Package stats306b :: Package lecture10 :: Module lda
[hide private]
[frames] | no frames]

Module lda

source code

Classes [hide private]
  lfunc
A linear function.
  qfunc
A quadratic function based on the log-likelihood of two Gaussian densities
Functions [hide private]
 
lgdens(x, mu, Sinv) source code
 
pooled_cov(X, Y)
Pooled estimate of covariance matrix of X broken up into classes by Y, a binary matrix
source code
 
LDA(labels, X)
Linear discriminant analysis, i.e.
source code
 
QDA(labels, X, ncomp=2)
Linear discriminant analysis, i.e.
source code
 
indicator(labels)
Create indicator variables from a sequence of labels.
source code
 
boundary(fns, iv, data, xlim=(0, 1), ylim=(0, 1), col=None, marker=None)
Plot decision boundaries based on a dictionary of discriminant functions.
source code
Function Details [hide private]

pooled_cov(X, Y)

source code 

Pooled estimate of covariance matrix of X broken up into classes by Y, a binary matrix

Returns

mu, Sigma, pooledS

LDA(labels, X)

source code 

Linear discriminant analysis, i.e. MLE discriminant analysis when the groups are assumed Gaussian with the same coavariance matrix.

Returns (fns, iv): a dictionary of discriminant functions, in the original variables.

QDA(labels, X, ncomp=2)

source code 

Linear discriminant analysis, i.e. MLE discriminant analysis when the groups are assumed Gaussian with unspecified covariance matrices.

Returns (fns, iv): a dictionary of (ncomp)*(ncomp-1)/2 discriminant functions, in the original variables, and the indicator variables.

boundary(fns, iv, data, xlim=(0, 1), ylim=(0, 1), col=None, marker=None)

source code 
Plot decision boundaries based on a dictionary of discriminant functions. Assumes they are functions of 2 variables.