RandProject: Random projection of input matrix X

Description Usage Arguments Value See Also Examples

View source: R/RandProject.R

Description

Perform a random projection (Gauss, Achlioptas or Li) of the input matrix X. Based on the RandPro package.

Usage

1
RandProject(xx, q, method = "gaussian")

Arguments

xx

The data matrix (n x p).

q

The target dimension.

method

Projection method using either a Gaussian ("gaussian"), a sparse ("achlioptas") or very sparse ("li") projection matrix. Default: "gaussian".

Value

Projected matrix (n x q).

See Also

form_matrix

Examples

1
2
3
4
5
6
7
8
  ## Project to 3 dimensions with Gaussian projection matrix
  RandProject(xx=matrix(rnorm(500),50,10), q=3)
  
  ## Achlioptas (sparse)
  RandProject(xx=matrix(rnorm(500),50,10), q=2, method='achlioptas')
  
  ## Li (very sparse)
  RandProject(xx=matrix(rnorm(5000),50,100), q=10, method='li')

btaschler/mcap documentation built on May 26, 2019, 1:31 a.m.