ltsa | R Documentation |
Apply the Local Tangent Space Alignment (LTSA) method (Zhang and Zha, 2004) for dimensionality reduction.
ltsa(
X,
n_neighbors = 15,
ndim = 2,
nn_method = "nnd",
eig_method = "rspectra",
include_self = TRUE,
normalize = FALSE,
ret_B = FALSE,
n_threads = 0,
verbose = FALSE,
...
)
X |
The input data matrix or dataframe with one observation per row. |
n_neighbors |
The size of local neighborhood (in terms of number of neighboring sample points) used for manifold approximation. |
ndim |
The dimension of the space to embed into. |
nn_method |
Method for finding nearest neighbors. Can be one of:
|
eig_method |
How to carry out the eigendecomposition. Possible values are:
|
include_self |
Should an item be part of its own neighborhood? This has
a minor effect on most results, but work by Zhang and co-workers (2017)
suggests that this is in effect the main difference between LTSA and the
Hessian Locally Linear Embedding (HLLE) method, so setting this to |
normalize |
If |
ret_B |
If |
n_threads |
Number of threads to use. Applies only to the nearest neighbor calculation. |
verbose |
If |
... |
Extra arguments to be passed to the eigendecomposition method
specified by
For
For
For more details see the documentation for |
Zhang, Z., & Zha, H. (2004). Principal manifolds and nonlinear dimensionality reduction via tangent space alignment. SIAM journal on scientific computing, 26(1), 313-338. https://doi.org/10.1137/S1064827502419154
Zhang, S., Ma, Z., & Tan, H. (2017). On the Equivalence of HLLE and LTSA. IEEE transactions on cybernetics, 48(2), 742-753. https://doi.org/10.1109/TCYB.2017.2655338
n <- 1000
max_z <- 10
phi <- stats::runif(n, min = 1.5 * pi, max = 4.5 * pi)
x <- phi * cos(phi)
y <- phi * sin(phi)
z <- stats::runif(n, max = max_z)
swiss_roll <- data.frame(x, y, z)
# unroll it
swiss_ltsa <- ltsa(swiss_roll)
plot(swiss_ltsa, col = phi)
# compare with PCA
swiss_pca <- stats::prcomp(swiss_roll, rank. = 2, scale = FALSE, retx = TRUE)$x
plot(swiss_pca, col = phi)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.