Package com.yahoo.labs.samoa.instances
Class FilteredSparseInstance
- java.lang.Object
-
- com.yahoo.labs.samoa.instances.InstanceImpl
-
- com.yahoo.labs.samoa.instances.SparseInstance
-
- com.yahoo.labs.samoa.instances.FilteredSparseInstance
-
- All Implemented Interfaces:
Instance
,MultiLabelInstance
,Serializable
public class FilteredSparseInstance extends SparseInstance
The Class FilteredSparseInstance. This class is an extension to the original SparseInstance. It has been created to be used with feature selection algorithms for data streams. In contrast to SparseInstance 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.InstanceImpl
instanceData, instanceHeader, weight
-
-
Constructor Summary
Constructors Constructor Description FilteredSparseInstance(double numberAttributes)
Instantiates a new sparse instance.FilteredSparseInstance(double d, double[] res)
Instantiates a new sparse instance.FilteredSparseInstance(double weight, double[] attributeValues, int[] indexValues, int numberAttributes)
Instantiates a new sparse instance.FilteredSparseInstance(InstanceImpl inst)
Instantiates a new sparse instance.
-
Method Summary
-
Methods inherited from class com.yahoo.labs.samoa.instances.InstanceImpl
addSparseValues, attribute, classAttribute, classIndex, classIsMissing, classValue, classValue, copy, dataset, deleteAttributeAt, index, indexOfAttribute, inputAttribute, insertAttributeAt, isMissing, isMissing, isMissingSparse, numAttributes, numberOutputTargets, numClasses, numInputAttributes, numOutputAttributes, numValues, outputAttribute, setClassValue, setClassValue, setDataset, setMissing, setMissing, setValue, setValue, setWeight, stringValue, toDoubleArray, toString, value, value, valueInputAttribute, valueOutputAttribute, valueSparse, weight
-
-
-
-
Constructor Detail
-
FilteredSparseInstance
public FilteredSparseInstance(double d, double[] res)
Instantiates a new sparse instance.- Parameters:
d
- the dres
- the res
-
FilteredSparseInstance
public FilteredSparseInstance(InstanceImpl inst)
Instantiates a new sparse instance.- Parameters:
inst
- the inst
-
FilteredSparseInstance
public FilteredSparseInstance(double numberAttributes)
Instantiates a new sparse instance.- Parameters:
numberAttributes
- the number attributes
-
FilteredSparseInstance
public FilteredSparseInstance(double weight, double[] attributeValues, int[] indexValues, int numberAttributes)
Instantiates a new sparse instance.- Parameters:
weight
- the weightattributeValues
- the attribute valuesindexValues
- the index valuesnumberAttributes
- the number attributes
-
-