Random feature
Random Fourier features (RFF) are a technique used in machine learning to approximate kernel methods, introduced by Ali Rahimi and Ben Recht in their 2007 paper "Random Features for Large-Scale Kernel Machines".[1]
RFF is a Monte Carlo approximation to the feature map associated with shift-invariant kernels. The method involves mapping the input data to a higher-dimensional space using randomly sampled sinusoidal functions. It is used for datasets that are too large for traditional kernel methods like support vector machine, kernel ridge regression, and gaussian process.
Mathematics
Because support vector machines and other models employing the kernel trick do not scale well to large numbers of training samples or large numbers of features in the input space, several approximations to the RBF kernel (and similar kernels) have been introduced.[2] Typically, these take the form of a function z that maps a single vector to a vector of higher dimensionality, approximating the kernel:
where is the implicit mapping embedded in the RBF kernel.
One way to construct such a z is to randomly sample from the Fourier transformation of the kernel[3]where are independent samples from the normal distribution .
Theorem: (unbiased esimation)
Proof: It suffices to prove the case of . Use the trigonometric identity , the spherical symmetry of gaussian distribution, then evaluate the integral
Theorem: (convergence) As the number of random features increases, the approximation converges to the true kernel with high probability.
Theorem: (variance bound) . (Appendix A.2[4]).
Variations
Orthogonal random features[5] uses a random orthogonal matrix instead of a random Fourier matrix.
See also
References
- ^ Rahimi, Ali; Recht, Benjamin (2007). "Random Features for Large-Scale Kernel Machines". Advances in Neural Information Processing Systems. 20.
- ^ Andreas Müller (2012). Kernel Approximations for Efficient SVMs (and other feature extraction methods).
- ^ Rahimi, Ali; Recht, Benjamin (2007). "Random Features for Large-Scale Kernel Machines". Advances in Neural Information Processing Systems. 20. Curran Associates, Inc.
- ^ Peng, Hao; Pappas, Nikolaos; Yogatama, Dani; Schwartz, Roy; Smith, Noah A.; Kong, Lingpeng (2021-03-19). "Random Feature Attention". arXiv:2103.02143 [cs.CL].
- ^ Yu, Felix Xinnan X; Suresh, Ananda Theertha; Choromanski, Krzysztof M; Holtmann-Rice, Daniel N; Kumar, Sanjiv (2016). "Orthogonal Random Features". Advances in Neural Information Processing Systems. 29. Curran Associates, Inc.