Description Usage Arguments Value Author(s) See Also

This function will return the classification of the samples of a test set using a *k*-nearest neighbors (KNN) algorithm with euclidean distances, given a formula and a train set.

1 2 3 4 5 | ```
getKNNpredictionFromFormula(model.formula,
trainData,
testData,
Outcome = "CLASS",
nk = 3)
``` |

`model.formula` |
An object of class |

`trainData` |
A data frame with the data to train the model, where all variables are stored in different columns |

`testData` |
A data frame similar to |

`Outcome` |
The name of the column in |

`nk` |
The number of neighbors used to generate the KNN classification |

`prediction` |
A vector with the predicted outcome for the |

`prob` |
The proportion of |

`binProb` |
The proportion of |

`featureList` |
A vector with the names of the features used by the KNN procedure |

Jose G. Tamez-Pena and Antonio Martinez-Torteya

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.