dgpage_predict | R Documentation |
After you have fit the DGPAGE model to some labeled training data Xtrain
, you can
project Xtrain
and store their embeddings Ytrain
, then for new data
Xtest
, you project them using the learned P
, and perform a 1-nearest neighbor
search in the low-dimensional subspace using Rnanoflann.
dgpage_predict(model, Xtest, k = 1, method = "euclidean")
model |
The list returned by |
Xtest |
A numeric matrix of size |
k |
Number of neighbors (default 1). |
method |
Distance method for |
A vector of length m
with predicted labels.
nn
## Not run:
# Suppose we already fit a model:
# model$Ytrain <- t(model$P) %*% model$Z # r x n -> we store its transpose below
# model$Ytrain_t <- t(model$Ytrain) # n x r
# model$ytrain <- y # training labels
#
# Now we get new data Xtest:
preds <- dgpage_predict(model, Xtest)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.