## org.apache.mahout.math.random
Class RandomProjector

    java.lang.Object
      org.apache.mahout.math.random.RandomProjector

    public final class RandomProjector

extends Object

Method Summary
`static Matrix` `generateBasisNormal(int projectedVectorSize, int vectorSize)` Generates a basis matrix of size projectedVectorSize x vectorSize.
`static Matrix` `generateBasisPlusMinusOne(int projectedVectorSize, int vectorSize)` Generates a basis matrix of size projectedVectorSize x vectorSize.
`static Matrix` `generateBasisZeroPlusMinusOne(int projectedVectorSize, int vectorSize)` Generates a basis matrix of size projectedVectorSize x vectorSize.
`static List<Vector>` `generateVectorBasis(int projectedVectorSize, int vectorSize)` Generates a list of projectedVectorSize vectors, each of size vectorSize.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### generateBasisNormal

    public static Matrix generateBasisNormal(int projectedVectorSize,
                                             int vectorSize)

  Generates a basis matrix of size projectedVectorSize x vectorSize. Multiplying a a vector by this matrix results in the projected vector. The rows of the matrix are sampled from a multi normal distribution.

  Parameters:
    `projectedVectorSize` - final projected size of a vector (number of projection vectors)
    `vectorSize` - initial vector size
  Returns:
    a projection matrix

### generateBasisPlusMinusOne

    public static Matrix generateBasisPlusMinusOne(int projectedVectorSize,
                                                   int vectorSize)

  Generates a basis matrix of size projectedVectorSize x vectorSize. Multiplying a a vector by this matrix results in the projected vector. The rows of a matrix are sample from a distribution where: - +1 has probability 1/2, - -1 has probability 1/2 See Achlioptas, D. (2003). Database-friendly random projections: Johnson-Lindenstrauss with binary coins. Journal of Computer and System Sciences, 66(4), 671–687. doi:10.1016/S0022-0000(03)00025-4

  Parameters:
    `projectedVectorSize` - final projected size of a vector (number of projection vectors)
    `vectorSize` - initial vector size
  Returns:
    a projection matrix

### generateBasisZeroPlusMinusOne

    public static Matrix generateBasisZeroPlusMinusOne(int projectedVectorSize,
                                                       int vectorSize)

  Generates a basis matrix of size projectedVectorSize x vectorSize. Multiplying a a vector by this matrix results in the projected vector. The rows of a matrix are sample from a distribution where: - 0 has probability 2/3, - +1 has probability 1/6, - -1 has probability 1/6 See Achlioptas, D. (2003). Database-friendly random projections: Johnson-Lindenstrauss with binary coins. Journal of Computer and System Sciences, 66(4), 671–687. doi:10.1016/S0022-0000(03)00025-4

  Parameters:
    `projectedVectorSize` - final projected size of a vector (number of projection vectors)
    `vectorSize` - initial vector size
  Returns:
    a projection matrix

### generateVectorBasis

    public static List<Vector> generateVectorBasis(int projectedVectorSize,
                                                   int vectorSize)

  Generates a list of projectedVectorSize vectors, each of size vectorSize. This looks like a matrix of size (projectedVectorSize, vectorSize).

  Parameters:
    `projectedVectorSize` - final projected size of a vector (number of projection vectors)
    `vectorSize` - initial vector size
  Returns:
    a list of projection vectors

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.