new SparseMatrix(numRows, numCols, colPtrs, rowIndices, values, isTransposed)
Parameters:
Name |
Type |
Description |
numRows |
number
|
|
numCols |
number
|
|
colPtrs |
Array.<number>
|
|
rowIndices |
Array.<number>
|
|
values |
Array.<number>
|
|
isTransposed |
boolean
|
|
- Source:
Extends
Methods
Generate a `SparseMatrix` from Coordinate List (COO) format. Input must be an array of
(i, j, value) tuples. Entries that have duplicate values of i and j are
added together. Tuples where value is equal to zero will be omitted.
Parameters:
Name |
Type |
Description |
numRows |
number
|
number of rows of the matrix |
numCols |
number
|
number of columns of the matrix |
entries |
Iterable
|
Array of (i, j, value) tuples |
- Source:
Returns:
The corresponding `SparseMatrix`
-
Type
-
module:eclairjs/mllib/linalg.SparseMatrix
Generate a diagonal matrix in `SparseMatrix` format from the supplied values.
Parameters:
- Source:
Returns:
Square `SparseMatrix` with size `values.length` x `values.length` and non-zero
-
Type
-
module:eclairjs/mllib/linalg.SparseMatrix
Generate an Identity Matrix in `SparseMatrix` format.
Parameters:
Name |
Type |
Description |
n |
number
|
number of rows and columns of the matrix |
- Source:
Returns:
`SparseMatrix` with size `n` x `n` and values of ones on the diagonal
-
Type
-
module:eclairjs/mllib/linalg.SparseMatrix
Generate a `SparseMatrix` consisting of `i.i.d`. uniform random numbers. The number of non-zero
elements equal the ceiling of `numRows` x `numCols` x `density`
Parameters:
Name |
Type |
Description |
numRows |
number
|
number of rows of the matrix |
numCols |
number
|
number of columns of the matrix |
density |
number
|
the desired density for the matrix |
rng |
Random
|
a random number generator |
- Source:
Returns:
`SparseMatrix` with size `numRows` x `numCols` and values in U(0, 1)
-
Type
-
module:eclairjs/mllib/linalg.SparseMatrix
Generate a `SparseMatrix` 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 |
density |
number
|
the desired density for the matrix |
rng |
Random
|
a random number generator |
- Source:
Returns:
`SparseMatrix` with size `numRows` x `numCols` and values in N(0, 1)
-
Type
-
module:eclairjs/mllib/linalg.SparseMatrix
$init$() → (nullable) {?}
- Inherited From:
- Source:
Returns:
-
Type
-
?
apply(i, j) → {number}
Parameters:
Name |
Type |
Description |
i |
number
|
|
j |
number
|
|
- Overrides:
- Source:
Returns:
-
Type
-
number
- Overrides:
- Source:
Returns:
-
Type
-
module:eclairjs/mllib/linalg.SparseMatrix
equals(o) → {boolean}
Parameters:
Name |
Type |
Description |
o |
object
|
|
- Source:
Returns:
-
Type
-
boolean
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
module:eclairjs/mllib/linalg.DenseMatrix
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
module:eclairjs/mllib/linalg.DenseVector
Parameters:
- 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>
Generate a `DenseMatrix` from the given `SparseMatrix`. The new matrix will have isTransposed
set to false.
- Source:
Returns:
-
Type
-
module:eclairjs/mllib/linalg.DenseMatrix
toString(maxLinesopt, maxLineWidthopt) → {string}
Parameters:
Name |
Type |
Attributes |
Description |
maxLines |
integer
|
<optional>
|
|
maxLineWidth |
integer
|
<optional>
|
|
- Inherited From:
- Source:
Returns:
-
Type
-
string
- Overrides:
- Source:
Returns:
-
Type
-
module:eclairjs/mllib/linalg.SparseMatrix