Description Usage Arguments Value Examples
Function knn.simple implements model building and prediction algorithm of k nearest neighbours in one function
1 | knn.simple(data, fact, test.data, metric, k = 5)
|
data |
data.frame contains values of our training set (bag-of-words format of text) |
fact |
factor containing proper classification of the training samples in data set (one per observation) |
test.data |
contains values of our testing set for classification |
metric |
function implementing the metric of the similarity |
k |
number of the nearest neighbours taken into acount |
vector of predicted labels for test.set
1 | knn.simple(train.data, label, test.data, 5, metric.cos)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.