### Manipulation of dissimilarity matrices

This page belongs to the User Guide of the DisTools Matlab package. It describes some of its commands. Links to other pages are listed above. More information can be found in the pages of the  PRTools User Guide. Links are given at the bottom of this page.

This group of commands contains routines that either change specific entries of a dissimilarity matrix, or generate subsets. The construction of such a subset affects both, the rows as well as the columns of a dissimilarity matrix, i.e. it selects some objects and adapts their representation.

The input dissimilarity matrices should be square: rows and columns should point to the same objects. Moreover, in the dataset the set of object labels should be identical to the set of feature labels. See the FAQ on square dissimilarities.

 dissimt Transforms similarities into dissimilarities or vice versa. makesym Make a dissimilarity matrix symmetric D2= D*makesym default is averaging D and D'. D2= D*makesym([],'min') use min(D,D') makemetric Make a square dissimilarity matrix metric D2 = D*makemetric All dissimilarities in D that violate the triangle inequality are updated genddat Generate random training and test sets for dissimilarity data, [DT,DS] = genddat(D,0.5) use 50% of the data for trainset (DT), remaining for testset (DS); repset is trainset [DT,DS] = genddat(D,[10 20],5) use 10 objects of first class and 20 of second for training. repset is first 5 objects of trainset seldclass Select class subset from a square dissimilarity dataset D2 = seldclass(D,[3 4]) Reduce square dissimilarity matrix such that only rows and columns of classes 3 and 4 are preserved