public class LabeledVectorSet<Row extends LabeledVector> extends Dataset<Row> implements AutoCloseable
Constructor and Description |
---|
LabeledVectorSet()
Default constructor (required by Externalizable).
|
LabeledVectorSet(double[][] mtx,
double[] lbs)
Creates new local Labeled Dataset by matrix and vector of labels.
|
LabeledVectorSet(double[][] mtx,
double[] lbs,
String[] featureNames,
boolean isDistributed)
Creates new Labeled Dataset by matrix and vector of labels.
|
LabeledVectorSet(int rowSize,
int colSize)
Creates new local Labeled Dataset and initialized with empty data structure.
|
LabeledVectorSet(int rowSize,
int colSize,
boolean isDistributed)
Creates new Labeled Dataset and initialized with empty data structure.
|
LabeledVectorSet(int rowSize,
int colSize,
String[] featureNames,
boolean isDistributed)
Creates new Labeled Dataset and initialized with empty data structure.
|
LabeledVectorSet(Row[] data)
Creates new Labeled Dataset by given data.
|
LabeledVectorSet(Row[] data,
int colSize)
Creates new Labeled Dataset by given data.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes LabeledDataset.
|
LabeledVectorSet |
copy()
Makes copy with new Label objects and old features and Metadata objects.
|
static Vector |
emptyVector(int size,
boolean isDistributed) |
double |
label(int idx)
Returns label if label is attached or null if label is missed.
|
double[] |
labels()
Returns new copy of labels of all labeled vectors NOTE: This method is useful for copying labels from test
dataset.
|
void |
setLabel(int idx,
double lb)
Fill the label with given value.
|
colSize, convertStringNamesToFeatureMetadata, data, equals, features, generateFeatureNames, getFeatureName, getRow, hashCode, isDistributed, meta, readExternal, rowSize, setData, setDistributed, setMeta, writeExternal
public LabeledVectorSet()
public LabeledVectorSet(int rowSize, int colSize, boolean isDistributed)
rowSize
- Amount of instances. Should be > 0.colSize
- Amount of attributes. Should be > 0.isDistributed
- Use distributed data structures to keep data.public LabeledVectorSet(int rowSize, int colSize)
rowSize
- Amount of instances. Should be > 0.colSize
- Amount of attributes. Should be > 0.public LabeledVectorSet(int rowSize, int colSize, String[] featureNames, boolean isDistributed)
rowSize
- Amount of instances. Should be > 0.colSize
- Amount of attributes. Should be > 0featureNames
- Column names.isDistributed
- Use distributed data structures to keep data.public LabeledVectorSet(Row[] data)
data
- Should be initialized with one vector at least.public LabeledVectorSet(Row[] data, int colSize)
data
- Should be initialized with one vector at least.colSize
- Amount of observed attributes in each vector.public LabeledVectorSet(double[][] mtx, double[] lbs)
mtx
- Given matrix with rows as observations.lbs
- Labels of observations.public LabeledVectorSet(double[][] mtx, double[] lbs, String[] featureNames, boolean isDistributed)
mtx
- Given matrix with rows as observations.lbs
- Labels of observations.featureNames
- Column names.isDistributed
- Use distributed data structures to keep data.public double label(int idx)
idx
- Index of observation.public double[] labels()
public void setLabel(int idx, double lb)
idx
- Index of observation.lb
- The given label.public static Vector emptyVector(int size, boolean isDistributed)
public LabeledVectorSet copy()
public void close() throws Exception
close
in interface AutoCloseable
Exception
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024