knn.simple: Function knn.simple implements model building and prediction...

Description Usage Arguments Value Examples

Description

Function knn.simple implements model building and prediction algorithm of k nearest neighbours in one function

Usage

1
knn.simple(data, fact, test.data, metric, k = 5)

Arguments

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

Value

vector of predicted labels for test.set

Examples

1
knn.simple(train.data, label, test.data, 5, metric.cos)

vovkaOst/TextClassifier documentation built on May 3, 2019, 6:41 p.m.