dat <- loadDataSet("3D S Curve", n = 300)
emb <- embed(dat, "DiffusionMaps")
plot(emb, type = "2vars")
# predicting is possible:
samp <- sample(floor(nrow(dat) / 10))
emb2 <- embed(dat[samp])
emb3 <- predict(emb2, dat[-samp])
plot(emb2, type = "2vars")
points(getData(emb3))
Run the code above in your browser using DataLab