Neural Networks  0.0.1
 All Classes Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
DataSet Class Reference

Public Member Functions

 DataSet (Attribute[] attrs, String[] labels)
 
void addInstance (String[] values, String label)
 
DataSet copyStruct ()
 
void shuffle ()
 

Public Attributes

ArrayList< Attributeattributes
 
ArrayList< String > attributeNames
 
ArrayList< String > labels
 
ArrayList< Instanceinstances
 

Detailed Description

DataSet Class. Parse a file into a data set, used both for training set and test set.

The attribute IS order in each dataset inside, but not required to be in the same order in different data set.

To find the value of an arbitary attribute, the best way is to use insts.attributes(trainSet.attri.indexOf("SomeAttribute"))

Constructor & Destructor Documentation

DataSet.DataSet ( Attribute[]  attrs,
String[]  labels 
)
inline

Constructor of DataSet.

Initialize the data set with Arrays of attribute and labels

Parameters
attrsAttribute array of this data set to use
labelsString arrray of the labels

Member Function Documentation

void DataSet.addInstance ( String[]  values,
String  label 
)
inline

Add an instance into the data set

Parameters
valuesString array of value of each attribute, in the order of attributes field
labelLabel of this instance
DataSet DataSet.copyStruct ( )
inline

Make a copy of attributes and labels of the current data set

Returns
A DataSet with the same attributes and labels
void DataSet.shuffle ( )
inline

Shuffle the instances in the data set

Member Data Documentation

ArrayList<String> DataSet.attributeNames

List of attributes names

ArrayList<Attribute> DataSet.attributes

List of attributes values

ArrayList<Instance> DataSet.instances

List of instances

ArrayList<String> DataSet.labels

List of labels


The documentation for this class was generated from the following file: