Random feature

term_id: random_feature

Category: basic_concepts

Definition

Random feature maps transform inputs into a new space where linear models can approximate non-linear kernel functions. This approach, often associated with the Nystrom method or Fourier features, allows for scalable kernel regression and classification. By avoiding the explicit computation of large kernel matrices, it reduces computational complexity from quadratic to linear in the number of samples, making it suitable for large-scale datasets.

Summary

A technique that maps input data into a higher-dimensional space using random projections to approximate kernel methods efficiently.

Key Concepts

  • Kernel approximation
  • Feature mapping
  • Computational efficiency
  • Linearization

Use Cases

  • Large-scale kernel regression
  • Neural tangent kernel approximation
  • Scalable Gaussian processes

Code Example

1
2
3
4
5
import numpy as np
from sklearn.kernel_approximation import RBFSampler
X = np.random.rand(100, 5)
transformer = RBFSampler(gamma=1, n_components=50, random_state=42)
X_transformed = transformer.fit_transform(X)