# mdsprox

Multidimensional scaling of proximity matrix

## Syntax

```[SC,EIGEN] = mdsprox(B,X) [SC,EIGEN] = mdsprox(B,X,'param1',val1,'param2',val2,...) ```

## Description

`[SC,EIGEN] = mdsprox(B,X)` applies classical multidimensional scaling to the proximity matrix computed for the data in the matrix `X`, and returns scaled coordinates `SC` and eigenvalues `EIGEN` of the scaling transformation. The method applies multidimensional scaling to the matrix of distances defined as 1-`prox`, where `prox` is the proximity matrix returned by the `proximity` method.

You can supply the proximity matrix directly by using the `'Data'` parameter.

`[SC,EIGEN] = mdsprox(B,X,'param1',val1,'param2',val2,...)` specifies optional parameter name/value pairs:

 `'Data'` Flag indicating how the method treats the `X` input argument. If set to `'predictors'` (default), `mdsprox` assumes `X` to be a matrix of predictors and used for computation of the proximity matrix. If set to `'proximity'`, the method treats `X` as a proximity matrix returned by the `proximity` method. `'Colors'` If you supply this argument, `mdsprox` makes overlaid scatter plots of two scaled coordinates using specified colors for different classes. You must supply the colors as a character vector or a string scalar with one letter for each color. If there are more classes in the data than letters in the supplied value, `mdsprox` plots only the first `C` classes, where `C` is the number of letters in the supplied value. For regression or if you do not provide the vector of true class labels, the method uses the first color for all observations in `X`. `'Labels'` Vector of true class labels for a classification ensemble. True class labels can be a numeric vector, character matrix, string array, or cell array of character vectors. If supplied, this vector must have as many elements as there are observations (rows) in `X`. This argument has no effect unless you also supply the `'Colors'` argument. `'MDSCoordinates'` Indices of the two scaled coordinates to plot. By default, `mdsprox` makes a scatter plot of the first and second scaled coordinates which correspond to the two largest eigenvalues. You can specify any other two or three indices not exceeding the dimensionality of the scaled data. This argument has no effect unless you also supply the `'Colors'` argument.