
@Title(value="Term frequency parser") @Description(value="Parse a file containing term frequencies. The expected format is \'label term1 <freq> term2 <freq> ...\'. Terms must not contain the separator character!") public class TermFrequencyParser<V extends SparseNumberVector> extends NumberVectorLabelParser<V>
SimpleTransactionParser instead.| Modifier and Type | Class and Description |
|---|---|
static class |
TermFrequencyParser.Parameterizer<V extends SparseNumberVector>
Parameterization class.
|
BundleStreamSource.Event| Modifier and Type | Field and Description |
|---|---|
(package private) gnu.trove.map.TObjectIntMap<String> |
keymap
Map.
|
(package private) ArrayList<String> |
labels
(Reused) label buffer.
|
private static Logging |
LOG
Class logger.
|
(package private) boolean |
normalize
Normalize.
|
(package private) int |
numterms
Number of different terms observed.
|
private SparseNumberVector.Factory<V> |
sparsefactory
Same as
NumberVectorLabelParser.factory, but subtype. |
(package private) gnu.trove.map.hash.TIntDoubleHashMap |
values
(Reused) set of values for the number vector.
|
attributes, columnnames, curlbl, curvec, factory, haslabels, maxdim, meta, mindim, nextevent, uniquereader, tokenizer| Constructor and Description |
|---|
TermFrequencyParser(boolean normalize,
CSVReaderFormat format,
long[] labelIndices,
SparseNumberVector.Factory<V> factory)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Logging |
getLogger()
Get the logger for this class.
|
protected SimpleTypeInformation<V> |
getTypeInformation(int mindim,
int maxdim)
Get a prototype object for the given dimensionality.
|
protected boolean |
parseLineInternal()
Internal method for parsing a single line.
|
buildMeta, cleanup, createVector, data, getMeta, initStream, isLabelColumn, nextEventasMultipleObjectsBundle, assignDBID, hasDBIDs, parseprivate static final Logging LOG
int numterms
gnu.trove.map.TObjectIntMap<String> keymap
boolean normalize
private SparseNumberVector.Factory<V extends SparseNumberVector> sparsefactory
NumberVectorLabelParser.factory, but subtype.gnu.trove.map.hash.TIntDoubleHashMap values
public TermFrequencyParser(boolean normalize,
CSVReaderFormat format,
long[] labelIndices,
SparseNumberVector.Factory<V> factory)
normalize - Normalizeformat - Input formatlabelIndices - Indices to use as labelsprotected boolean parseLineInternal()
NumberVectorLabelParserparseLineInternal in class NumberVectorLabelParser<V extends SparseNumberVector>true when a valid line was read, false on a label
row.protected SimpleTypeInformation<V> getTypeInformation(int mindim, int maxdim)
NumberVectorLabelParsergetTypeInformation in class NumberVectorLabelParser<V extends SparseNumberVector>mindim - Minimum dimensionalitymaxdim - Maximum dimensionalityprotected Logging getLogger()
AbstractStreamingParsergetLogger in class NumberVectorLabelParser<V extends SparseNumberVector>Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.