if(requireNamespace(c("NNMF", "MASS"), quietly = TRUE)) {
set.seed(4646)
dat <- loadDataSet("Iris")
emb <- embed(dat, "NNMF")
plot(emb)
# project new values:
nn_proj <- predict(emb, dat[1:7])
plot(nn_proj)
}
Run the code above in your browser using DataLab