KNN-C: KNN-C KEEL Classification Algorithm

Description Usage Arguments Value Examples

Description

KNN-C Classification Algorithm from KEEL.

Usage

1
KNN_C(train, test, k, distance)

Arguments

train

Train dataset as a data.frame object

test

Test dataset as a data.frame object

k

Number of neighbors

distance

Distance function

Value

A data.frame with the actual and predicted classes for both train and test datasets.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data_train <- RKEEL::loadKeelDataset("iris_train")
data_test <- RKEEL::loadKeelDataset("iris_test")

#Create algorithm
algorithm <- RKEEL::KNN_C(data_train, data_test)

#Run algorithm
algorithm$run()

#See results
algorithm$testPredictions

Example output

/usr/local/lib/R/site-library/RKEELdata/datasets//usr/local/lib/R/site-library/RKEELdata/datasets/OpenJDK 64-Bit Server VM warning: Can't detect initial thread stack location - find_vma failed
sh: 1: cannot create /dev/null: Permission denied
/work/tmp/tmp/RtmpMmqyk9/experiment_2018-02-27_14-55-112815/results/KNN-C.data/result0.tra
/work/tmp/tmp/RtmpMmqyk9/experiment_2018-02-27_14-55-112815/results/KNN-C.data/result0.tst
Error! Error in private$readOutputs(paste0(private$mainPath, "/results/", private$algorithmName, : Results were not stored. Execution error.
NULL

RKEEL documentation built on Aug. 10, 2017, 5:05 p.m.

Related to KNN-C in RKEEL...