Learn R Programming

dprep (version 3.0.2)

knngow: K-nn classification using Gower distance

Description

This function performs classification using the k- nearest neighbors but using Gower distance rather than Euclidean distance. It is recommended if the dataset has niminal and continuous attributes.

Usage

knngow(train, test, k)

Arguments

train
A matrix containing the training dataset.
test
A matrix containing the test dataset.
k
The number of neighbors to be used.

Value

  • predclassA vector of predited classes

See Also

acugow

Examples

Run this code
data(crx)
knngow(crx,crx,3)

Run the code above in your browser using DataLab