Class SparseVectorFieldFilter<V extends SparseNumberVector>
- java.lang.Object
-
- elki.datasource.filter.AbstractConversionFilter<V,V>
-
- elki.datasource.filter.typeconversions.SparseVectorFieldFilter<V>
-
- Type Parameters:
V- Vector type
- All Implemented Interfaces:
ObjectFilter
public class SparseVectorFieldFilter<V extends 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
-
-
Constructor Summary
Constructors Constructor Description SparseVectorFieldFilter()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SimpleTypeInformation<? super V>convertedType(SimpleTypeInformation<V> in)Get the output type from the input type after conversion.protected VfilterSingleObject(V obj)Normalize a single instance.protected SimpleTypeInformation<? super V>getInputTypeRestriction()Get the input type restriction used for negotiating the data query.protected LogginggetLogger()Class logger.protected voidprepareProcessInstance(V obj)Process a single object during initialization.protected booleanprepareStart(SimpleTypeInformation<V> in)Return "true" when the normalization needs initialization (two-pass filtering!).-
Methods inherited from class elki.datasource.filter.AbstractConversionFilter
filter, prepareComplete, toString
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
maxdim
int maxdim
Maximum dimension.
-
-
Method Detail
-
prepareStart
protected boolean prepareStart(SimpleTypeInformation<V> in)
Description copied from class:AbstractConversionFilterReturn "true" when the normalization needs initialization (two-pass filtering!).- Overrides:
prepareStartin classAbstractConversionFilter<V extends SparseNumberVector,V extends SparseNumberVector>- Parameters:
in- Input type information- Returns:
- true or false
-
prepareProcessInstance
protected void prepareProcessInstance(V obj)
Description copied from class:AbstractConversionFilterProcess a single object during initialization.- Overrides:
prepareProcessInstancein classAbstractConversionFilter<V extends SparseNumberVector,V extends SparseNumberVector>- Parameters:
obj- Object to process
-
filterSingleObject
protected V filterSingleObject(V obj)
Description copied from class:AbstractConversionFilterNormalize a single instance. You can implement this as UnsupportedOperationException if you override both public "normalize" functions!- Specified by:
filterSingleObjectin classAbstractConversionFilter<V extends SparseNumberVector,V extends SparseNumberVector>- Parameters:
obj- Database object to normalize- Returns:
- Normalized database object
-
getInputTypeRestriction
protected SimpleTypeInformation<? super V> getInputTypeRestriction()
Description copied from class:AbstractConversionFilterGet the input type restriction used for negotiating the data query.- Specified by:
getInputTypeRestrictionin classAbstractConversionFilter<V extends SparseNumberVector,V extends SparseNumberVector>- Returns:
- Type restriction
-
convertedType
protected SimpleTypeInformation<? super V> convertedType(SimpleTypeInformation<V> in)
Description copied from class:AbstractConversionFilterGet the output type from the input type after conversion.- Specified by:
convertedTypein classAbstractConversionFilter<V extends SparseNumberVector,V extends SparseNumberVector>- Parameters:
in- input type restriction- Returns:
- output type restriction
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractConversionFilterClass logger.- Specified by:
getLoggerin classAbstractConversionFilter<V extends SparseNumberVector,V extends SparseNumberVector>- Returns:
- Logger
-
-