# NOT RUN {
## generate data of 2 types with clear difference
diff = 5
dt1 = aux.gensamples(n=123)-diff;
dt2 = aux.gensamples(n=123)+diff;
## merge the data and create a label correspondingly
Y = rbind(dt1,dt2)
label = c(rep(1,123), rep(2,123))
## try different neighborhood size
out1 <- do.klde(Y, label, kcentering=TRUE, numk=5)
out2 <- do.klde(Y, label, numk=10)
out3 <- do.klde(Y, label, numk=25)
## visualize
par(mfrow=c(1,3))
plot(out1$Y[,1], out1$Y[,2], main="k=5")
plot(out2$Y[,1], out2$Y[,2], main="k=10")
plot(out3$Y[,1], out3$Y[,2], main="k=25")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab