fitmodel.knn: This function specifically handles fitting knn models. This...

Description Usage Arguments Value Examples

Description

This function specifically handles fitting knn models. This handles everything that needs to be done when fitting a knn model.

Usage

1
2
## S3 method for class 'knn'
fitmodel(mod, k = -1, metric = "euclidian")

Arguments

mod

The knn model.

k

The k value for the model. The default in this case in -1 which in the function is changed to the calculation of the square root of the number of rows of data.

metric

The metric. The default is set to "euclidian".

Value

The fitted knn model. This is an object of classes "knn" and "model".

Examples

1
fitmodel(mod = new_knn_model(data=iris, design = Species ~ .), k=3, metric="euclidian")

emilyklisa/mli documentation built on May 25, 2019, 5:21 p.m.