opf_knn_train | R Documentation |
Executes the training phase of the OPF classifier with knn adjacency
opf_knn_train(trainFile, evaluatFile, kmax, precomputedDistance = NA)
trainFile |
The training object produced by the opf_split (subGraph object) |
evaluatFile |
The evaluation object produced by the opf_split (subGraph object) |
kmax |
The kmax (maximum degree for the knn graph) |
precomputedDistance |
The precomputed distance matrix produced by the opf_distance (leave it in blank if you are not using this resource) |
Returns a list which contains the classifier object and the classification list object
Returns a list which contains the classifier object and the classification list object (i.e., clusters' id)
dat <- opf_read_subGraph(system.file("extdata/boat.dat",package = "LibOPF")) X <- opf_split(dat,0.3,0.2,0.5,0) T <- X$training T2 <- X$testing E <- X$evaluating Y <- opf_knn_train(T,E,100) class <- opf_knn_classify(T2, Y$classifier) acc <- opf_accuracy(T2, class)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.