| Modifier and Type | Method and Description |
|---|---|
static BinarySparseDataset |
from(java.nio.file.Path path)
Parse a binary sparse dataset from a file, of which each line is a data
item which are the indices of nonzero elements.
|
default int |
get(int i,
int j)
Returns the binary value at entry (i, j) by binary search.
|
int |
length()
Returns the number of nonzero entries.
|
int |
ncols()
Returns the number of columns.
|
static BinarySparseDataset |
of(java.util.Collection<int[]> data)
Returns a default implementation of BinarySparseDataset from a collection.
|
smile.math.matrix.SparseMatrix |
toMatrix()
Returns the Harwell-Boeing column-compressed sparse matrix.
|
int length()
int ncols()
default int get(int i,
int j)
i - the row index.j - the column index.smile.math.matrix.SparseMatrix toMatrix()
static BinarySparseDataset of(java.util.Collection<int[]> data)
data - Each row is a data item which are the indices of
nonzero elements. Every row will be sorted into
ascending order.static BinarySparseDataset from(java.nio.file.Path path) throws java.io.IOException, java.lang.NumberFormatException
path - the input file path.java.io.IOException - if stream to file cannot be read or closed.java.lang.NumberFormatException - if an entry is not an integer.