Class SparseVectorFieldFilter<V extends elki.data.SparseNumberVector>

  • Type Parameters:
    V - Vector type
    All Implemented Interfaces:
    elki.datasource.filter.ObjectFilter

    public class SparseVectorFieldFilter<V extends elki.data.SparseNumberVector>
    extends AbstractConversionFilter<V,​V>
    Class that turns sparse float vectors into a proper vector field, by setting the maximum dimensionality for each vector.
    Since:
    0.5.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static elki.logging.Logging LOG
      Class logger.
      (package private) int maxdim
      Maximum dimension.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected elki.data.type.SimpleTypeInformation<? super V> convertedType​(elki.data.type.SimpleTypeInformation<V> in)
      Get the output type from the input type after conversion.
      protected V filterSingleObject​(V obj)
      Normalize a single instance.
      protected elki.data.type.SimpleTypeInformation<? super V> getInputTypeRestriction()
      Get the input type restriction used for negotiating the data query.
      protected elki.logging.Logging getLogger()
      Class logger.
      protected void prepareProcessInstance​(V obj)
      Process a single object during initialization.
      protected boolean prepareStart​(elki.data.type.SimpleTypeInformation<V> in)
      Return "true" when the normalization needs initialization (two-pass filtering!).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        Class logger.
      • maxdim

        int maxdim
        Maximum dimension.
    • Constructor Detail

      • SparseVectorFieldFilter

        public SparseVectorFieldFilter()
        Constructor.
    • Method Detail

      • prepareStart

        protected boolean prepareStart​(elki.data.type.SimpleTypeInformation<V> in)
        Description copied from class: AbstractConversionFilter
        Return "true" when the normalization needs initialization (two-pass filtering!).
        Overrides:
        prepareStart in class AbstractConversionFilter<V extends elki.data.SparseNumberVector,​V extends elki.data.SparseNumberVector>
        Parameters:
        in - Input type information
        Returns:
        true or false
      • prepareProcessInstance

        protected void prepareProcessInstance​(V obj)
        Description copied from class: AbstractConversionFilter
        Process a single object during initialization.
        Overrides:
        prepareProcessInstance in class AbstractConversionFilter<V extends elki.data.SparseNumberVector,​V extends elki.data.SparseNumberVector>
        Parameters:
        obj - Object to process
      • filterSingleObject

        protected V filterSingleObject​(V obj)
        Description copied from class: AbstractConversionFilter
        Normalize a single instance. You can implement this as UnsupportedOperationException if you override both public "normalize" functions!
        Specified by:
        filterSingleObject in class AbstractConversionFilter<V extends elki.data.SparseNumberVector,​V extends elki.data.SparseNumberVector>
        Parameters:
        obj - Database object to normalize
        Returns:
        Normalized database object
      • getInputTypeRestriction

        protected elki.data.type.SimpleTypeInformation<? super V> getInputTypeRestriction()
        Description copied from class: AbstractConversionFilter
        Get the input type restriction used for negotiating the data query.
        Specified by:
        getInputTypeRestriction in class AbstractConversionFilter<V extends elki.data.SparseNumberVector,​V extends elki.data.SparseNumberVector>
        Returns:
        Type restriction
      • convertedType

        protected elki.data.type.SimpleTypeInformation<? super V> convertedType​(elki.data.type.SimpleTypeInformation<V> in)
        Description copied from class: AbstractConversionFilter
        Get the output type from the input type after conversion.
        Specified by:
        convertedType in class AbstractConversionFilter<V extends elki.data.SparseNumberVector,​V extends elki.data.SparseNumberVector>
        Parameters:
        in - input type restriction
        Returns:
        output type restriction