Class 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
    • Constructor Detail

      • FilteredSparseInstanceData

        public FilteredSparseInstanceData​(double[] attributeValues,
                                          int[] indexValues,
                                          int numberAttributes)
        Instantiates a new sparse instance data.
        Parameters:
        attributeValues - the attribute values
        indexValues - the index values
        numberAttributes - 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 interface InstanceData
        Overrides:
        value in class SparseInstanceData
        Parameters:
        indexAttribute - the index attribute
        Returns:
        the double