# NOT RUN {
# require(NMF)
#
# X = cbind(rnorm(mean=-1, sd=1, n=200), rnorm(mean=-1, sd=1, n=200))
# X = rbind(X, cbind(rnorm(mean=1, sd=1, n=200), rnorm(mean=1, sd=1, n=200)))
# Y = c(rep(-1,200), rep(+1,200))
# plot(X, col=Y+2, pch=20, cex=3, cex.axis=2)
#
# model = build_classifier(X, Y, train.size=0.5, quantile.percentage=1,
# min.points=10, gamma.length=15, cost=10000)
# result = apply_classifier(model, X)
# points(X, col=as.numeric(result$classification.ensembled)+2, pch=20, cex=1.5)
#
# x = seq(min(X), max(X), length=100)
# z = outer(x, x, function(x,y) {
# apply_classifier(model, as.matrix(cbind(x,y)))$classification.ensembled } )
# filled.contour(x,x,z)
#
# x = seq(min(X), max(X), length=100)
# z = outer(x, x, function(x,y) {
# apply_classifier(model, as.matrix(cbind(x,y)),
# only.best.classifiers=TRUE)$classification.ensembled } )
# locator(1)
# filled.contour(x,x,z)
# }
Run the code above in your browser using DataLab