ARFF_COMMENT, ARFF_SPARSE, ARFF_SPARSE_END, ATTRIBUTE, DATA, RELATION
Constructor and Description |
---|
MapBackedARFFModel() |
MapBackedARFFModel(Map<String,Long> words,
long wordCount,
Map<String,Map<String,Integer>> nominalMap) |
Modifier and Type | Method and Description |
---|---|
void |
addDateFormat(Integer idx,
DateFormat format) |
void |
addLabel(String label,
Integer idx) |
void |
addNominal(String label,
String nominal,
int idx) |
void |
addType(Integer idx,
ARFFType type) |
ARFFType |
getARFFType(Integer idx) |
DateFormat |
getDateFormat(Integer idx) |
Map<Integer,DateFormat> |
getDateMap()
Map of Date formatters used
|
Map<String,Integer> |
getLabelBindings()
The vector attributes (labels in Mahout speak), unmodifiable
|
Integer |
getLabelIndex(String label) |
int |
getLabelSize() |
Map<String,Map<String,Integer>> |
getNominalMap()
Map nominals to ids.
|
Integer |
getNominalValue(String label,
String nominal) |
String |
getRelation() |
Map<Integer,ARFFType> |
getTypeMap()
The map of types encountered
|
double |
getValue(String data,
int idx)
Convert a piece of String data at a specific spot into a value
|
long |
getWordCount()
The count of the number of words seen
|
Map<String,Long> |
getWords()
Immutable map of words to the long id used for those words
|
static boolean |
isNumeric(String str) |
protected double |
processDate(String data,
int idx) |
protected double |
processNominal(String label,
String data) |
protected static double |
processNumeric(String data) |
protected double |
processString(String data) |
void |
setRelation(String relation) |
public String getRelation()
getRelation
in interface ARFFModel
public void setRelation(String relation)
setRelation
in interface ARFFModel
public double getValue(String data, int idx)
protected double processString(String data)
protected static double processNumeric(String data)
public static boolean isNumeric(String str)
protected double processDate(String data, int idx)
public Map<String,Integer> getLabelBindings()
getLabelBindings
in interface ARFFModel
public Map<Integer,DateFormat> getDateMap()
public Map<String,Map<String,Integer>> getNominalMap()
ARFFModel.addNominal(String, String, int)
getNominalMap
in interface ARFFModel
public Map<String,Long> getWords()
public Integer getNominalValue(String label, String nominal)
getNominalValue
in interface ARFFModel
public void addNominal(String label, String nominal, int idx)
addNominal
in interface ARFFModel
public DateFormat getDateFormat(Integer idx)
getDateFormat
in interface ARFFModel
public void addDateFormat(Integer idx, DateFormat format)
addDateFormat
in interface ARFFModel
public Integer getLabelIndex(String label)
getLabelIndex
in interface ARFFModel
public ARFFType getARFFType(Integer idx)
getARFFType
in interface ARFFModel
public long getWordCount()
getWordCount
in interface ARFFModel
public int getLabelSize()
getLabelSize
in interface ARFFModel
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.