Class: DenseMatrix

eclairjs/mllib/linalg. DenseMatrix

new DenseMatrix(numRows, numCols, values, isTransposed)

Parameters:
Name Type Description
numRows number
numCols number
values Array.<number>
isTransposed boolean
Source:

Extends

Methods

(static) diag(vector) → {module:eclairjs/mllib/linalg.DenseMatrix}

Generate a diagonal matrix in `DenseMatrix` format from the supplied values.
Parameters:
Name Type Description
vector module:eclairjs/mllib/linalg.Vector a `Vector` that will form the values on the diagonal of the matrix on the diagonal
Source:
Returns:
Square `DenseMatrix` with size `values.length` x `values.length` and `values`
Type
module:eclairjs/mllib/linalg.DenseMatrix

(static) eye(n) → {module:eclairjs/mllib/linalg.DenseMatrix}

Generate an Identity Matrix in `DenseMatrix` format.
Parameters:
Name Type Description
n number number of rows and columns of the matrix
Source:
Returns:
`DenseMatrix` with size `n` x `n` and values of ones on the diagonal
Type
module:eclairjs/mllib/linalg.DenseMatrix

(static) ones(numRows, numCols) → {module:eclairjs/mllib/linalg.DenseMatrix}

Generate a `DenseMatrix` consisting of ones.
Parameters:
Name Type Description
numRows number number of rows of the matrix
numCols number number of columns of the matrix
Source:
Returns:
`DenseMatrix` with size `numRows` x `numCols` and values of ones
Type
module:eclairjs/mllib/linalg.DenseMatrix

(static) rand(numRows, numCols, rng) → {module:eclairjs/mllib/linalg.DenseMatrix}

Generate a `DenseMatrix` consisting of `i.i.d.` uniform random numbers.
Parameters:
Name Type Description
numRows number number of rows of the matrix
numCols number number of columns of the matrix
rng Random a random number generator
Source:
Returns:
`DenseMatrix` with size `numRows` x `numCols` and values in U(0, 1)
Type
module:eclairjs/mllib/linalg.DenseMatrix

(static) randn(numRows, numCols, rng) → {module:eclairjs/mllib/linalg.DenseMatrix}

Generate a `DenseMatrix` consisting of `i.i.d.` gaussian random numbers.
Parameters:
Name Type Description
numRows number number of rows of the matrix
numCols number number of columns of the matrix
rng Random a random number generator
Source:
Returns:
`DenseMatrix` with size `numRows` x `numCols` and values in N(0, 1)
Type
module:eclairjs/mllib/linalg.DenseMatrix

(static) zeros(numRows, numCols) → {module:eclairjs/mllib/linalg.DenseMatrix}

Generate a `DenseMatrix` consisting of zeros.
Parameters:
Name Type Description
numRows number number of rows of the matrix
numCols number number of columns of the matrix
Source:
Returns:
`DenseMatrix` with size `numRows` x `numCols` and values of zeros
Type
module:eclairjs/mllib/linalg.DenseMatrix

$init$() → (nullable) {?}

Inherited From:
Source:
Returns:
Type
?

apply(i, j) → {number}

Parameters:
Name Type Description
i number
j number
Overrides:
Source:
Returns:
Type
number

copy() → {module:eclairjs/mllib/linalg.DenseMatrix}

Overrides:
Source:
Returns:
Type
module:eclairjs/mllib/linalg.DenseMatrix

equals(o) → {boolean}

Parameters:
Name Type Description
o object
Source:
Returns:
Type
boolean

hashCode() → {number}

Source:
Returns:
Type
number

multiply0(y) → {module:eclairjs/mllib/linalg.DenseMatrix}

Parameters:
Name Type Description
y module:eclairjs/mllib/linalg.DenseMatrix
Inherited From:
Source:
Returns:
Type
module:eclairjs/mllib/linalg.DenseMatrix

multiply1(y) → {module:eclairjs/mllib/linalg.DenseVector}

Parameters:
Name Type Description
y module:eclairjs/mllib/linalg.DenseVector
Inherited From:
Source:
Returns:
Type
module:eclairjs/mllib/linalg.DenseVector

multiply2(y) → {module:eclairjs/mllib/linalg.DenseVector}

Parameters:
Name Type Description
y module:eclairjs/mllib/linalg.Vector
Inherited From:
Source:
Returns:
Type
module:eclairjs/mllib/linalg.DenseVector

numActives() → {number}

Overrides:
Source:
Returns:
Type
number

numCols() → {number}

Inherited From:
Source:
Returns:
Type
number

numNonzeros() → {number}

Overrides:
Source:
Returns:
Type
number

numRows() → {number}

Inherited From:
Source:
Returns:
Type
number

toArray() → {Array.<number>}

Inherited From:
Source:
Returns:
Type
Array.<number>

toSparse() → {module:eclairjs/mllib/linalg.SparseMatrix}

Generate a `SparseMatrix` from the given `DenseMatrix`. The new matrix will have isTransposed set to false.
Source:
Returns:
Type
module:eclairjs/mllib/linalg.SparseMatrix

toString(maxLinesopt, maxLineWidthopt) → {string}

Parameters:
Name Type Attributes Description
maxLines integer <optional>
maxLineWidth integer <optional>
Inherited From:
Source:
Returns:
Type
string

transpose() → {module:eclairjs/mllib/linalg.DenseMatrix}

Overrides:
Source:
Returns:
Type
module:eclairjs/mllib/linalg.DenseMatrix