[source]

Gaussian Random Projector#

A random projector is a dimensionality reducer based on the Johnson-Lindenstrauss lemma that uses a random matrix to project feature vectors onto a user-specified number of dimensions. It is faster than most non-randomized dimensionality reduction techniques such as PCA or LDA and it offers similar results. This version utilizes a random matrix sampled from a smooth Gaussian distribution.

Interfaces: Transformer, Stateful

Data Type Compatibility: Continuous only

Parameters#

# Param Default Type Description
1 dimensions int The number of target dimensions to project onto.

Additional Methods#

Estimate the minimum dimensionality needed given total sample size and max distortion using the Johnson-Lindenstrauss lemma:

public static estimate(int $n, float $maxDistortion = 0.1) : int

Example#

use Rubix\ML\Transformers\GaussianRandomProjector;

$dimensions = GaussianRandomProjector::estimate(2000);

$transformer = new GaussianRandomProjector($dimensions); // Using estimate

$transformer = new GaussianRandomProjector(100); // Specifying dimensionality