|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--learn.DataSet
The DataSet
class is used to load data from text files into
memory for use in training or testing.
Field Summary | |
protected boolean |
allNumericData
|
protected java.util.Vector |
data
|
protected java.util.Vector |
fieldList
|
protected int |
fieldsPerRec
|
protected java.lang.String |
fileName
|
protected java.lang.String |
name
|
protected java.util.Vector |
normalizedData
|
protected int |
normFieldsPerRec
|
protected int |
numRecords
|
javax.swing.JTextArea |
textArea1
|
protected java.util.Hashtable |
variableList
|
Constructor Summary | |
DataSet(java.lang.String name,
java.lang.String fileName)
Creates a dataset with the given name that will be populated from the specified file. |
Method Summary | |
void |
addVariable(Variable var)
Adds a variable to the list of fields in the record. |
void |
displayNormalizedData()
Displays the normalized data. |
void |
displayVariables()
Displays all variables and their values. |
int |
getClassFieldSize()
Retrieves the size of the class field. |
java.lang.String |
getClassFieldValue(double[] activations,
int index)
Retrieves the class field value for a given activation. |
java.lang.String |
getClassFieldValue(int recIndex)
Retrieves the class field value for the given record index. |
int |
getFieldsPerRec()
Method getFieldsPerRec |
java.lang.String |
getFileName()
Method getFileName |
java.util.Vector |
getNormalizedData()
Method getNormalizedData |
int |
getNormalizedRecordSize()
Computes the record size after each variablel in the record is normalized. |
int |
getNormFieldsPerRec()
Method getNormFieldsPerRec |
int |
getNumRecords()
Method getNumRecords |
void |
loadDataFile()
Reads the data from the file defined by the data file definition. |
void |
loadDataFileDefinition()
Reads the data file definition which is a simple text files that contains a list of the field data types and their names. |
void |
normalizeData()
Normalizes a record by translating discrete data to a one-of-N vector and by scaling all continuous data to be in the 0.0 to 1.0 range. |
void |
setDisplay(javax.swing.JTextArea textArea)
Sets the text area to be displayed for the dataset information. |
void |
trace(java.lang.String text)
Adds text to the text area for display. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected java.lang.String name
protected java.lang.String fileName
protected boolean allNumericData
protected java.util.Vector data
protected java.util.Vector normalizedData
protected java.util.Hashtable variableList
protected java.util.Vector fieldList
protected int fieldsPerRec
protected int normFieldsPerRec
protected int numRecords
public transient javax.swing.JTextArea textArea1
Constructor Detail |
public DataSet(java.lang.String name, java.lang.String fileName)
name
- the String that contains the name of the datasetfileName
- the text file from which the dataset is populatedMethod Detail |
public void trace(java.lang.String text)
text
- the String to be displayedpublic void setDisplay(javax.swing.JTextArea textArea)
textArea
- the JTextArea text area to be displayedpublic void displayVariables()
public int getNumRecords()
public int getFieldsPerRec()
public int getNormFieldsPerRec()
public java.util.Vector getNormalizedData()
public java.lang.String getFileName()
public void loadDataFileDefinition()
public int getClassFieldSize()
public void loadDataFile()
public void addVariable(Variable var)
var
- the Variable object to be added to the listpublic int getNormalizedRecordSize()
public java.lang.String getClassFieldValue(int recIndex)
recIndex
- the int record indexpublic java.lang.String getClassFieldValue(double[] activations, int index)
activations
- the double array of activations from which the class field
value is retrievedindex
- the starting index of the output unitpublic void normalizeData()
public void displayNormalizedData()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |