RotMatRand {ODRF}R Documentation

Random Rotation Matrix

Description

Generate rotation matrices by different distributions, and it comes from the library rerf.

Usage

RotMatRand(
  dimX,
  randDist = "Binary",
  numProj = ceiling(sqrt(dimX)),
  dimProj = "Rand",
  sparsity = ifelse(dimX >= 10, 3/dimX, 1/dimX),
  prob = 0.5,
  lambda = 1,
  catLabel = NULL,
  ...
)

Arguments

dimX

The number of dimensions.

randDist

The probability distribution of the random projection direction, including "Binary": B\{-1,1\} binomial distribution (default), "Norm":N(0,1) normal distribution, "Uniform": U(-1,1) uniform distribution.

numProj

The number of projection directions (default ceiling(sqrt(dimX))).

dimProj

Number of variables to be projected, default dimProj="Rand": random from 1 to dimX.

sparsity

A real number in (0,1) that specifies the distribution of non-zero elements in the random matrix. When sparsity="pois" means that non-zero elements are generated by the p(lambda) Poisson distribution.

prob

A probability in (0,1) used for sampling from {-1,1} where prob = 0 will only sample -1 and prob = 1 will only sample 1.

lambda

Parameter of the Poisson distribution (default 1).

catLabel

A category labels of class list in predictors. (default NULL, for details see Examples of ODT)

...

Used to handle superfluous arguments passed in using paramList.

Value

A random matrix to use in running ODT.

References

Tomita, T. M., Browne, J., Shen, C., Chung, J., Patsolic, J. L., Falk, B., ... & Vogelstein, J. T. (2020). Sparse projection oblique randomer forests. Journal of machine learning research, 21(104).

See Also

RotMatPPO RotMatRF RotMatMake

Examples

set.seed(1)
paramList <- list(dimX = 8, numProj = 3, sparsity = 0.25, prob = 0.5)
(RotMat <- do.call(RotMatRand, paramList))
paramList <- list(dimX = 8, numProj = 3, sparsity = "pois")
(RotMat <- do.call(RotMatRand, paramList))
paramList <- list(dimX = 8, randDist = "Norm", dimProj = 5)
(RotMat <- do.call(RotMatRand, paramList))


[Package ODRF version 0.0.4 Index]