johnson_lindenstrauss_min_dim#
- cuml.random_projection.johnson_lindenstrauss_min_dim(n_samples, eps=0.1)[source]#
Find a ‘safe’ number of components to randomly project to.
The Johnson–Lindenstrauss lemma states that high-dimensional data can be embedded into lower dimension while preserving the distances.
This function finds the minimum number of components to guarantee that the embedding is inside the eps error tolerance.
- Parameters:
- n_samplesint
Number of samples.
- epsfloat in (0,1) (default = 0.1)
Maximum distortion rate as defined by the Johnson-Lindenstrauss lemma.
- Returns:
- n_componentsint
The minimal number of components to guarantee with good probability an eps-embedding with n_samples.