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

Given a training and a test set, the function apply the centroid classifier and returns the classification labels of the observations in the training and in test set. It also gives the training misclassification rate and the test misclassification rate, if the truth class labels of the test set are provided in input.

1 | ```
centroidcl(train, test, cl, cl.test = NULL)
``` |

`train` |
A matrix of data (the training set) with observations in rows and variables in column. It can be a matrix or a dataframe. |

`test` |
A matrix of data (the test set) with observations in rows and variables in columns. It can be a matrix or a dataframe. |

`cl` |
A vector of class labels for each sample of the training set. It can be factor or numerical. |

`cl.test` |
A vector of class labels for each sample of the test set (optional) |

`centroidcl`

carries out the centroid classifier and predicts classification.

A list with components

`cl.train ` |
Predicted classification in the training set |

`cl.test ` |
Predicted classification in the test set |

`me.train ` |
Misclassification error in the training set |

`me.test ` |
Misclassification error in the test set (only if |

Christian Hennig, Cinzia Viroli

See Also `theta.cl`

1 2 3 4 5 6 7 8 9 10 11 12 |

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.