Implementation of Random Projection for homogeneous polynomial kernel feature spaces, introduced in [1]. This is a Python implementation, accelerated using numba. Bellow you can see how the algorithm preserves pairwise distances from the kernel feature space as the size of the output space (n_components) grows. This visualization was generated for 500 MNIST samples with p=5000, t=20 and degree=2.
The following pseudo-code describes the implemented algorithm. For a higher-level description of the algorithm, please refer to the original publication.