Package smile.data
Class BinarySparseSequenceDataset
java.lang.Object
smile.data.SimpleDataset<int[][],int[]>
smile.data.BinarySparseSequenceDataset
- All Implemented Interfaces:
Iterable<SampleInstance<int[][],
,int[]>> Dataset<int[][],
int[]>
Binary sparse sequence dataset. Each sequence element has sparse binary feature values.
-
Constructor Summary
ConstructorsConstructorDescriptionBinarySparseSequenceDataset
(int p, int k, List<SampleInstance<int[][], int[]>> data) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
k()
Returns the number of classes of sequence elements.static BinarySparseSequenceDataset
Loads a sparse sequence dataset.int
p()
Returns the number of features of sequence elements.Tuple[][]
seq()
Returns the sequence data.int[][]
tag()
Returns the sequence element label.int[][]
x()
Returns the flatten sequence data.int[]
y()
Returns the flatten sequence element label.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BinarySparseSequenceDataset
Constructor.- Parameters:
p
- The number of features of sequence elements.k
- The number of classes of sequence elements.data
- The sample instances.
-
-
Method Details
-
p
public int p()Returns the number of features of sequence elements.- Returns:
- the number of features of sequence elements.
-
k
public int k()Returns the number of classes of sequence elements.- Returns:
- the number of classes of sequence elements.
-
seq
Returns the sequence data.- Returns:
- the sequence data.
-
tag
public int[][] tag()Returns the sequence element label.- Returns:
- the sequence element label.
-
x
public int[][] x()Returns the flatten sequence data.- Returns:
- the flatten sequence data.
-
y
public int[] y()Returns the flatten sequence element label.- Returns:
- the flatten sequence element label.
-
load
Loads a sparse sequence dataset.- Parameters:
path
- the path to data file.- Returns:
- the sparse sequence dataset.
- Throws:
IOException
- when fails to read the file.
-