Learn R Programming

LibOPF (version 2.5.0)

opf_distance: Generates the precomputed distance file for the OPF classifier

Description

Generates the precomputed distance file for the OPF classifier

Usage

opf_distance(dataSet, distanceOp, normalize = 0)

Arguments

dataSet

The subGraph object, normaly is the whole data

distanceOp

Distance calculation option

normalize

Distance normalization? 1- yes 0 - no

Value

Returns the distance matrix

Details

Options for distance calculation: 1 - Euclidean 2 - Chi-Square 3 - Manhattan (L1) 4 - Canberra 5 - Squared Chord 6 - Squared Chi-Squared 7 - BrayCurtis

Examples

Run this code
# NOT RUN {
dat <- opf_read_subGraph(system.file("extdata/boat.dat",package = "LibOPF"))
dist <- opf_distance(dat,3,0)
X <- opf_split(dat,0.5,0,0.5,0)
T <- X$training
T2 <- X$testing
Y <- opf_train(T,dist)
class <- opf_classify(T2, Y$classifier,dist)
acc <- opf_accuracy(T2, class)

# }

Run the code above in your browser using DataLab