Description Usage Arguments Details Value Author(s) References See Also Examples

This function computes the class centroids and covariance matrix for a training set for determining Mahalanobis distances of samples to each class centroid.

1 2 3 4 5 6 7 |

`x` |
a matrix or data frame of predictor variables |

`...` |
optional arguments to pass (not currently used) |

`y` |
a numeric or factor vector of class labels |

`groups` |
an integer for the number of bins for splitting a numeric outcome |

`pca` |
a logical: should principal components analysis be applied to the dataset prior to splitting the data by class? |

`keep` |
an integer for the number of PCA components that should by used to predict new samples ( |

`object` |
an object of class |

`newdata` |
a matrix or data frame. If |

`trans` |
an optional function that can be applied to each class distance. |

For factor outcomes, the data are split into groups for each class
and the mean and covariance matrix are calculated. These are then
used to compute Mahalanobis distances to the class centers (using
`predict.classDist`

The function will check for non-singular matrices.

For numeric outcomes, the data are split into roughly equal sized
bins based on `groups`

. Percentiles are used to split the data.

for `classDist`

, an object of class `classDist`

with
elements:

`values ` |
a list with elements for each class. Each element contains a mean vector for the class centroid and the inverse of the class covariance matrix |

`classes` |
a character vector of class labels |

`pca` |
the results of |

`call` |
the function call |

`p` |
the number of variables |

`n` |
a vector of samples sizes per class |

For `predict.classDist`

, a matrix with columns for each class.
The columns names are the names of the class with the prefix
`dist.`

. In the case of numeric `y`

, the class labels are
the percentiles. For example, of `groups = 9`

, the variable names
would be `dist.11.11`

, `dist.22.22`

, etc.

Max Kuhn

Forina et al. CAIMAN brothers: A family of powerful classification and class modeling techniques. Chemometrics and Intelligent Laboratory Systems (2009) vol. 96 (2) pp. 239-245

1 2 3 4 5 6 7 8 9 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.