The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information.... 
Home MathPack MemBL Class TMemBasedLearner Methods CalcContingencyTable  
See also: AdjustedRandIx, Lambda, ModelData  
CalcContingencyTable 

A method to test the cluster purity of given clusters is to look at the nearest neighbors of each object of the model data. If the nearest neighbors for all objects belong to the same class the corresponding cluster (defined by its class number) is obviously pure. Thus counting the class assignments of the nearest neighbors results in a contingency table which reflects the purity of the clusters. The method CalcContingencyTable calculates this contingency table looking at NumNb nearest neighbors. The parameter VarIx is the index of the target variable containing the class numbers. The target variable must be either nominal or ordinal. Please note that the contingency table implicitly depends on the properties DistMode and ScalingMode. The variables used for the calculation of the nearest neighbors are given by the property VarType. The resulting contingency table is returned in the variable array ContTab, which is a quadratic matrix one column and row larger than the number of classes (the additional column and row contain the margin sums). The function returns the following error codes: 0 ... everything is OK
