Function er_project projects the embedding into a two or more dimensional space using the non-linear dimensionality reduction techniques MDS, UMAP, and PaCMAP.
er_project(embedding, method = "mds", k = 2, ..., verbose = FALSE)a numeric matrix containing a text embedding.
a character string specifying the type of projection. One of c("mds","umap","pacmap"). Default is "mds". Projection method "PaCMAP" is based on the Python library pacmap (see pypi.org/project/pacmap/) and requires access to a python environment
an integer determining the number of dimensions. Default is 2.
additional parameters handed to the projection method.
a logical indicating whether to show messages.
The function returns a matrix containing an embedding with columns representing the projected coordinates. The matrix has nrow(embedding) rows and k columns.
Wulff, D. U., Aeschbach, S., Hussain, Z., & Mata, R. (2024). embeddeR. In preparation.
if (FALSE) {
# project embedding
embedding <- embedding %>%
er_project()
}