Documentation of 'smile.data.BinarySparseDataset' Java class
BinarySparseDataset
smile.data

Class BinarySparseDataset

  • All Implemented Interfaces:
    java.lang.Iterable<Datum<int[]>>


    public class BinarySparseDataset
    extends Dataset<int[]>
    Binary sparse dataset. Each item is stored as an integer array, which are the indices of nonzero elements in ascending order.
    • Constructor Detail

      • BinarySparseDataset

        public BinarySparseDataset()
        Constructor.
      • BinarySparseDataset

        public BinarySparseDataset(java.lang.String name)
        Constructor.
        Parameters:
        name - the name of dataset.
      • BinarySparseDataset

        public BinarySparseDataset(java.lang.String name,
                                   Attribute response)
        Constructor.
        Parameters:
        name - the name of dataset.
        response - the attribute type of response variable.
      • BinarySparseDataset

        public BinarySparseDataset(int ncols)
        Constructor.
        Parameters:
        ncols - the number of columns in the matrix.
    • Method Detail

      • ncols

        public int ncols()
        Returns the number of columns.
      • add

        public Datum<int[]> add(Datum<int[]> datum)
        Add a datum item into the dataset.
        Overrides:
        add in class Dataset<int[]>
        Parameters:
        datum - a datum item. The indices of nonzero elements will be sorted into ascending order.
        Returns:
        the added datum item.
      • get

        public int get(int i,
                       int j)
        Returns the value at entry (i, j) by binary search.
        Parameters:
        i - the row index.
        j - the column index.
      • toSparseMatrix

        public SparseMatrix toSparseMatrix()
        Convert into Harwell-Boeing column-compressed sparse matrix format.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.