ir <- iris[-c(95:130), ]
smogn1 <- SMOGNClassif(Species~., ir)
smogn2 <- SMOGNClassif(Species~., ir, C.perc=list(setosa=0.5,versicolor=2.5))
# checking visually the results
plot(sort(ir$Sepal.Width))
plot(sort(smogn1$Sepal.Width))
# using a relevance function provided by the user
rel <- matrix(0, ncol = 3, nrow = 0)
rel <- rbind(rel, c(2, 1, 0))
rel <- rbind(rel, c(3, 0, 0))
rel <- rbind(rel, c(4, 1, 0))
smognRel <- SmoteRegress(Sepal.Width~., ir, rel = rel, dist = "HEOM",
C.perc = list(4, 0.5, 4))
plot(sort(smognRel$Sepal.Width))
Run the code above in your browser using DataLab