de.lmu.ifi.dbs.elki.datasource.filter
Class TFIDFNormalization

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.filter.AbstractConversionFilter<O,O>
      extended by de.lmu.ifi.dbs.elki.datasource.filter.AbstractNormalization<SparseFloatVector>
          extended by de.lmu.ifi.dbs.elki.datasource.filter.InverseDocumentFrequencyNormalization
              extended by de.lmu.ifi.dbs.elki.datasource.filter.TFIDFNormalization
All Implemented Interfaces:
Normalization<SparseFloatVector>, ObjectFilter, InspectionUtilFrequentlyScanned, Parameterizable

public class TFIDFNormalization
extends InverseDocumentFrequencyNormalization

Perform full TF-IDF Normalization as commonly used in text mining. Each record is first normalized using "term frequencies" to sum up to 1. Then it is globally normalized using the Inverse Document Frequency, so rare terms are weighted stronger than common terms. Restore will only undo the IDF part of the normalization!


Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.datasource.filter.InverseDocumentFrequencyNormalization
idf, objcnt
 
Constructor Summary
TFIDFNormalization()
          Constructor.
 
Method Summary
protected  SparseFloatVector filterSingleObject(SparseFloatVector featureVector)
          Normalize a single instance.
 
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.filter.InverseDocumentFrequencyNormalization
getInputTypeRestriction, prepareComplete, prepareProcessInstance, prepareStart, restore
 
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.filter.AbstractNormalization
convertedType, normalizeObjects, toString, transform
 
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.filter.AbstractConversionFilter
filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.datasource.filter.ObjectFilter
filter
 

Constructor Detail

TFIDFNormalization

public TFIDFNormalization()
Constructor.

Method Detail

filterSingleObject

protected SparseFloatVector filterSingleObject(SparseFloatVector featureVector)
Description copied from class: AbstractConversionFilter
Normalize a single instance. You can implement this as UnsupportedOperationException if you override both public "normalize" functions!

Overrides:
filterSingleObject in class InverseDocumentFrequencyNormalization
Parameters:
featureVector - Database object to normalize
Returns:
Normalized database object

Release 0.4.0 (2011-09-20_1324)