org.apache.mahout.utils.vectors.arff
Interface ARFFModel

All Known Implementing Classes:
MapBackedARFFModel

public interface ARFFModel

An interface for representing an ARFFModel. Implementations can decide on the best approach for storing the model, as some approaches will be fine for smaller files, while larger ones may require a better implementation.


Field Summary
static String ARFF_COMMENT
           
static String ARFF_SPARSE
           
static String ARFF_SPARSE_END
           
static String ATTRIBUTE
           
static String DATA
           
static String RELATION
           
 
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<String,Integer> getLabelBindings()
          The vector attributes (labels in Mahout speak)
 Integer getLabelIndex(String label)
           
 int getLabelSize()
           
 Map<String,Map<String,Integer>> getNominalMap()
           
 Integer getNominalValue(String label, String nominal)
           
 String getRelation()
           
 double getValue(String data, int idx)
           
 long getWordCount()
          The count of the number of words seen
 Map<String,Long> getWords()
           
 void setRelation(String relation)
           
 

Field Detail

ARFF_SPARSE

static final String ARFF_SPARSE
See Also:
Constant Field Values

ARFF_SPARSE_END

static final String ARFF_SPARSE_END
See Also:
Constant Field Values

ARFF_COMMENT

static final String ARFF_COMMENT
See Also:
Constant Field Values

ATTRIBUTE

static final String ATTRIBUTE
See Also:
Constant Field Values

DATA

static final String DATA
See Also:
Constant Field Values

RELATION

static final String RELATION
See Also:
Constant Field Values
Method Detail

getRelation

String getRelation()

setRelation

void setRelation(String relation)

getLabelBindings

Map<String,Integer> getLabelBindings()
The vector attributes (labels in Mahout speak)

Returns:
the map

getNominalValue

Integer getNominalValue(String label,
                        String nominal)

addNominal

void addNominal(String label,
                String nominal,
                int idx)

getDateFormat

DateFormat getDateFormat(Integer idx)

addDateFormat

void addDateFormat(Integer idx,
                   DateFormat format)

getLabelIndex

Integer getLabelIndex(String label)

addLabel

void addLabel(String label,
              Integer idx)

getARFFType

ARFFType getARFFType(Integer idx)

addType

void addType(Integer idx,
             ARFFType type)

getWordCount

long getWordCount()
The count of the number of words seen

Returns:
the count

getValue

double getValue(String data,
                int idx)

getNominalMap

Map<String,Map<String,Integer>> getNominalMap()

getLabelSize

int getLabelSize()

getWords

Map<String,Long> getWords()


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.