|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.utils.vectors.arff.MapBackedARFFModel
public class MapBackedARFFModel
Holds ARFF information in Map
.
Field Summary |
---|
Fields inherited from interface org.apache.mahout.utils.vectors.arff.ARFFModel |
---|
ARFF_COMMENT, ARFF_SPARSE, ARFF_SPARSE_END, ATTRIBUTE, DATA, RELATION |
Constructor Summary | |
---|---|
MapBackedARFFModel()
|
|
MapBackedARFFModel(Map<String,Long> words,
long wordCount,
Map<String,Map<String,Integer>> nominalMap)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MapBackedARFFModel()
public MapBackedARFFModel(Map<String,Long> words, long wordCount, Map<String,Map<String,Integer>> nominalMap)
Method Detail |
---|
public String getRelation()
getRelation
in interface ARFFModel
public void setRelation(String relation)
setRelation
in interface ARFFModel
public double getValue(String data, int idx)
getValue
in interface ARFFModel
data
- The data to convertidx
- The position in the ARFF data
protected double processNominal(String label, String data)
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,ARFFType> getTypeMap()
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()
getWords
in interface ARFFModel
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 void addLabel(String label, Integer idx)
addLabel
in interface ARFFModel
public ARFFType getARFFType(Integer idx)
getARFFType
in interface ARFFModel
public void addType(Integer idx, ARFFType type)
addType
in interface ARFFModel
public long getWordCount()
getWordCount
in interface ARFFModel
public int getLabelSize()
getLabelSize
in interface ARFFModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |