The Johnson-Lindenstrauss lemma says that a random linear map to roughly O(log n / ε²) dimensions preserves pairwise distances up to a factor (1 ± ε). A Gaussian random projection is the simplest such map, and it needs no training.
Implement gaussian_random_projection(X, k, seed=0). Return an array of shape (n, k).
np.random.default_rng(seed).(d, k) with independent N(0, 1) entries, then divide by √k.k ≥ 1, otherwise raise ValueError.X.No results yet
Run your code to check it against the examples, or submit to run every test.