# load the dataset
data(iris2D)
# create new class with some samples
class <- as.character(iris2D$Species)
class[iris2D$Petal.Length > 6] <- "newclass"
iris2D$Species <- as.factor(class)
# usage of the default method
set.seed(9)
outdef <- pai_bdir_ln(x = iris2D[,-ncol(iris2D)], y = iris2D[,ncol(iris2D)],
level = 0.1, pairs = list(c(1,2), c(3,4)),
order = c("virginica", "setosa", "newclass", "versicolor"))
# show results
summary(outdef, showid = TRUE)
plot(outdef)
# usage of the method for class formula
set.seed(9)
outfrm <- pai_bdir_ln(formula = Species ~ ., data = iris2D,
level = 0.1, pairs = list(c(1,2), c(3,4)),
order = c("virginica", "setosa", "newclass", "versicolor"))
# check the match of noisy indices
identical(outdef$idnoise, outfrm$idnoise)
Run the code above in your browser using DataLab