 scalabindings

package scalabindings

Mahout matrices and vectors' scala syntactic sugar

Linear Supertypes
AnyRef, Any
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. scalabindings
2. AnyRef
3. Any
1. Hide All
2. Show all
Visibility
1. Public
2. All

Type Members

3. type MMBinaryFunc = (Matrix, Matrix, Option[Matrix]) ⇒ Matrix

Binary matrix-matrix operations which may save result in-place, optionally

4. type MMUnaryFunc = (Matrix, Option[Matrix]) ⇒ Matrix

Matrix-matrix unary func

9. class MatlabLikeVectorOps extends VectorOps

R-like operators.

13. class RLikeVectorOps extends VectorOps

R-like operators

15. class VectorOps extends AnyRef

Syntactic sugar for mahout vectors

Value Members

5. object MatlabLikeOps

Matlab-like operators.

7. object RLikeOps

R-like operators.

9. def colMeanStdevs(mxA: Matrix): (Vector, Vector)

Compute column-wise means and stdevs.

Compute column-wise means and stdevs.

mxA

input

returns

colMeans → colStdevs

10. def colMeanVars(mxA: Matrix): (Vector, Vector)

Compute column-wise means and variances.

Compute column-wise means and variances.

returns

colMeans → colVariances

11. def dense[R](rows: R*): DenseMatrix

Create dense matrix out of inline arguments -- rows -- which can be tuples, iterables of Double, or just single Number (for columnar vectors)

Create dense matrix out of inline arguments -- rows -- which can be tuples, iterables of Double, or just single Number (for columnar vectors)

R
rows
returns

12. def densityAnalysis(mx: Matrix, threshold: Double = 0.25): Boolean

Check the density of an in-core matrix based on supplied criteria.

Check the density of an in-core matrix based on supplied criteria. Returns true if we think mx is denser than threshold with at least 80% confidence.

mx

The matrix to check density of.

threshold

the threshold of non-zero elements above which we consider a Matrix Dense

20. def eigen(m: Matrix): (Matrix, Vector)

Computes Eigendecomposition of a symmetric matrix

Computes Eigendecomposition of a symmetric matrix

m

symmetric input matrix

returns

(V, eigen-values-vector)

21. def eigenFull(m: Matrix, symmetric: Boolean = true): Unit

More general version of eigen decomposition

More general version of eigen decomposition

m
symmetric
returns

(V, eigenvalues-real-vector, eigenvalues-imaginary-vector)

31. def qr(m: Matrix): (Matrix, Matrix)

QR.

QR.

Right now Mahout's QR seems to be using argument for in-place transformations, so the matrix context gets messed after this. Hence we force cloning of the argument before passing it to Mahout's QR so to keep expected semantics.

m
returns

(Q,R)

33. def solve(a: Matrix, b: Vector): Vector

Solution x of A*x = b using QR-Decomposition, where A is a square, non-singular matrix.

Solution x of A*x = b using QR-Decomposition, where A is a square, non-singular matrix.

a
b
returns

(x)

34. def solve(a: Matrix): Matrix

Solution A^{-1} of A*A^{-1} = I using QR-Decomposition, where A is a square, non-singular matrix.

Solution A^{-1} of A*A^{-1} = I using QR-Decomposition, where A is a square, non-singular matrix. Here only for compatibility with R semantics.

a
returns

(A^{-1})

35. def solve(a: Matrix, b: Matrix): Matrix

Solution X of A*X = B using QR-Decomposition, where A is a square, non-singular matrix.

Solution X of A*X = B using QR-Decomposition, where A is a square, non-singular matrix.

a
b
returns

(X)

36. def sparse(rows: Vector*): SparseRowMatrix

Default initializes are always row-wise.

Default initializes are always row-wise. create a sparse, e.g.

```m = sparse(
(0,5)::(9,3)::Nil,
(2,3.5)::(7,8)::Nil
)```
rows
returns

37. def sqDist(mxX: Matrix, mxY: Matrix): Matrix

Pairwise squared distance computation.

Pairwise squared distance computation.

mxX

X, m x d

mxY

Y, n x d

returns

pairwise squaired distances of row-wise data points in X and Y (m x n)

38. def sqDist(mxX: Matrix): Matrix

Compute square distance matrix.

Compute square distance matrix. We assume data points are row-wise, similar to R's dist().

39. def svd(m: Matrix): (Matrix, Matrix, DenseVector)

computes SVD

computes SVD

m

svd input

returns

(U,V, singular-values-vector)

40. def svec(sdata: TraversableOnce[(Int, AnyVal)], cardinality: Int = 1): RandomAccessSparseVector

create a sparse vector out of list of tuple2's

create a sparse vector out of list of tuple2's

sdata

cardinality

returns