The Complete SPRLIB & ANNLIB

Calc_Dist_Class

- calculate the minimal Mahalanobis distance of a pattern given the coefficients

SYNOPSIS

int Calc_Dist_Class (Pattern, label, Wa2, Wa1, Wa0, Dist, Class, No, n)

ARGUMENTS

double *Pattern The pattern of which the minimal distance has to be computed.
int *label A list of possible class labels, see GetLabels.
double ***Wa2 An array of matrices of size [1..No][1..n][1..n] containing the quadratic terms W2i.
double **Wa1 An array of vectors of size [1..No][1..n], containing the linear terms W1i.
double *Wa0 An array of constants of size [1..No], containing the constant terms W0i.
double *Dist The minimal distance.
int *Class The class having the minimal distance to Pattern.
int No The number of classes.
int n The dimensionality of the pattern Pattern.

RETURNS

The function returns TRUE if an error occurred, otherwise FALSE. If no error occured Class and Dist contain valid values, see description of the argumentlist.

FUNCTION

In order to classify with the Mahalanobis distance measure the minimal distance of a pattern to the classes has to be determined. This function calculates the distances of a pattern pattern to the classes using their coefficients given by Wa2, Wa1, Wa0 , see mahal_multiclass_dataset, and returns the minimal distance and the class to which the pattern Pattern has the minimal distance.

NOTE

For the format of the variables see also mahal_multiclass_dataset.

SEE ALSO

mahal_multiclass_dataset

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