jlTransform
- :
Y =jlTransform(X, k)¶ - :
[Y, R] =jlTransform(X, k)¶ Johnson–Lindenstrauss Gaussian random projection of the columns of X.
Y = jlTransform (X, K)maps an n-by-d numeric matrix X (rows are points / observations) to an n-by-k sketch Y via a dense Gaussian projection matrixR = randn (d, k) / sqrt (k), so thatY = X * R.The optional second output returns that projection matrix R. Randomness comes from the current global random stream (
randn); seed withrngfor reproducibility.Output class follows X for floating-point inputs (
double/single). Logical and integer X are promoted todouble.Behaviour note (MATLAB R2026a): MathWorks does not ship
jlTransformin R2026a (exist ('jlTransform')is 0; the closest core sketching entry point issvdsketch). This Nexus API is the classical scaled Gaussian Johnson–Lindenstrauss map, which preserves pairwise \ell_2 distances among rows of X with high probability for k on the order of O(\varepsilon^{-2} \log n) (nexus#1945).