The Complete SPRLIB & ANNLIB

mahal_multiclass_dataset

- determine the Mahalanobis coefficients for all classes in the set

SYNOPSIS

int mahal_multiclass_dataset (Dset, ClassL, W2, W1, W0)

ARGUMENTS

DATASET *Dset The dataset of which the coefficients have to be determined.
int *ClassL The classlabels of the classes present in Dset.
double ***W2 An array of matrices of size [1..Dset->NumOutputs] [1..Dset->NumInputs] [1..Dset->NumInputs] containing the quadratic terms W2i for each class in the dataset.
double **W1 An array of vectors of size [1..Dset->Dset->NumOutputs] [1..Dset->NumInputs], containing the linear terms W1i for each class in the dataset.
double *W0 An array of constants of size [1..Dset->NumOutputs], containing the constant terms W0i for each class in the dataset.

RETURNS

The function returns TRUE if an error occured, FALSE otherwise. If no error occured then W2, W1, W0 contain valid values for calculating the Mahalanobis distances.

FUNCTION

The Mahalanobis distance measure is a quadratic term of the form : d = (Mi - x)^ T * Gi * (Mi - x) = x^T * W2i * x + W1i * x + W0i. Where d is the distance, Mi the mean of class i and Gi its covariance matrix. Note that x^T means the tranpose of x. Actually it is the Euclidean distance of a pattern to a class mean weighted by the covariance of the particular class. In order to determine the Mahalanobis distance three coefficients have to be determined on for each class. This function calculates these components for each class in the dataset Dset, whereas mahal_dataset only works for a single class.

NOTE

The variable W0 is in vector format, W1 in matrix format and each entry in W2 is in matrix format, but the array index for ***W2 runs from 0..NumberOfClasses .

SEE ALSO

mahal_dataset

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998