|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.flow.core.DatasetHelper
public class DatasetHelper
Helper class for converting to and from xrff datasets
| Field Summary | |
|---|---|
protected static DateFormat |
m_DateFormat
for formatting dates. |
| Constructor Summary | |
|---|---|
DatasetHelper()
|
|
| Method Summary | |
|---|---|
static void |
addAttribute(Dataset dataset,
String name,
Type type)
Adds an attribute to the dataset. |
static void |
addStatistic(Dataset dataset,
String name,
double value)
Adds a statistic as key/value pair to the dataset as new data row. |
static void |
addValue(Instance inst,
int index,
double value)
Adds the double value to the Instance. |
static void |
addValue(Instance inst,
int index,
String value)
Adds the string value to the Instance. |
static String |
datasetToString(Dataset dataset)
For outputting the dataset in debug mode. |
static Dataset |
evaluationToDataset(Evaluation eval)
Turns the evaluation object into a Dataset structure. |
static Dataset |
fromInstances(Instances inst)
static class that converts an instances object into an xrff dataset |
static DateFormat |
getDateFormat()
Returns the DateFormat instance to use. |
static Instances |
toInstances(Dataset d)
static class that converts an xrff dataset object into a weka instances object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static DateFormat m_DateFormat
| Constructor Detail |
|---|
public DatasetHelper()
| Method Detail |
|---|
public static Dataset fromInstances(Instances inst)
inst - instances object to be converted
public static Instances toInstances(Dataset d)
d - dataset to convert
public static String datasetToString(Dataset dataset)
dataset - the dataset to output
public static void addAttribute(Dataset dataset,
String name,
Type type)
dataset - the dataset to add the attribute toname - the name of the attributetype - the type of the attribute
public static void addValue(Instance inst,
int index,
String value)
Instance.
inst - the instance to add the value toindex - the attribute indexvalue - the value to set
public static void addValue(Instance inst,
int index,
double value)
Instance.
inst - the instance to add the value toindex - the attribute indexvalue - the value to set
public static void addStatistic(Dataset dataset,
String name,
double value)
dataset - the dataset to add the row toname - the name of the statistic (key)value - the value of the statisticpublic static Dataset evaluationToDataset(Evaluation eval)
Dataset structure.
eval - the evaluation to convert
public static DateFormat getDateFormat()
DateFormat instance to use.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||