class documentation
Converts featuresets and labeled featuresets to ARFF-formatted strings, appropriate for input into Weka.
Features and classes can be specified manually in the constructor, or may be determined from data using from_train.
Static Method | from |
Constructs an ARFF_Formatter instance with class labels and feature types determined from the given data. Handles boolean, numeric and string (note: not nominal) types. |
Method | __init__ |
No summary |
Method | data |
Returns the ARFF data section for the given data. |
Method | format |
Returns a string representation of ARFF output for the given data. |
Method | header |
Returns an ARFF header as a string. |
Method | labels |
Returns the list of classes. |
Method | write |
Writes ARFF data to a file for the given data. |
Method | _fmt |
Undocumented |
Instance Variable | _features |
Undocumented |
Instance Variable | _labels |
Undocumented |
Constructs an ARFF_Formatter instance with class labels and feature types determined from the given data. Handles boolean, numeric and string (note: not nominal) types.
Parameters | |
labels | A list of all class labels that can be generated. |
features | A list of feature specifications, where each feature specification is a tuple (fname, ftype); and ftype is an ARFF type string such as NUMERIC or STRING. |
Returns the ARFF data section for the given data.
Parameters | |
tokens | a list of featuresets (dicts) or labelled featuresets which are tuples (featureset, label). |
labeled | Indicates whether the given tokens are labeled or not. If None, then the tokens will be assumed to be labeled if the first token's value is a tuple or list. |