Package com.yahoo.labs.samoa.instances
Class FilteredSparseInstanceData
- java.lang.Object
-
- com.yahoo.labs.samoa.instances.SparseInstanceData
-
- com.yahoo.labs.samoa.instances.FilteredSparseInstanceData
-
- All Implemented Interfaces:
InstanceData
,Serializable
public class FilteredSparseInstanceData extends SparseInstanceData
The Class FilteredSparseInstanceData. This class is an extension to the original SparseInstanceData. It has been created to be used with feature selection algorithms for data streams. In contrast to SparseInstanceData objects, missing values are represented as NaNs instead of 0s (zeros). This allows learners to skip features with missing values.- Author:
- Jean Paul Barddal
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.yahoo.labs.samoa.instances.SparseInstanceData
attributeValues, indexValues, numberAttributes
-
-
Constructor Summary
Constructors Constructor Description FilteredSparseInstanceData(double[] attributeValues, int[] indexValues, int numberAttributes)
Instantiates a new sparse instance data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
value(int indexAttribute)
Value of the attribute in the indexAttribute position.-
Methods inherited from class com.yahoo.labs.samoa.instances.SparseInstanceData
copy, deleteAttributeAt, getAttributeValues, getIndexValues, getNumberAttributes, index, insertAttributeAt, isMissing, isMissingSparse, locateIndex, numAttributes, numValues, setAttributeValues, setIndexValues, setNumberAttributes, setValue, toDoubleArray, valueSparse
-
-
-
-
Constructor Detail
-
FilteredSparseInstanceData
public FilteredSparseInstanceData(double[] attributeValues, int[] indexValues, int numberAttributes)
Instantiates a new sparse instance data.- Parameters:
attributeValues
- the attribute valuesindexValues
- the index valuesnumberAttributes
- the number attributes
-
-
Method Detail
-
value
public double value(int indexAttribute)
Value of the attribute in the indexAttribute position. If this value is absent, a NaN value (marker of missing value) is returned, otherwise this method returns the actual value.- Specified by:
value
in interfaceInstanceData
- Overrides:
value
in classSparseInstanceData
- Parameters:
indexAttribute
- the index attribute- Returns:
- the double
-
-