jbnc.dataset
Class DatasetReaderInt
java.lang.Object
jbnc.dataset.DatasetReader
jbnc.dataset.DatasetReaderInt
- public final class DatasetReaderInt
- extends DatasetReader
Functions for reading data sets with test cases. Variables are assumed to be
'descrete' or 'ignore'.
- Since:
- June 1, 1999
- Author:
- Jarek Sacha
- See Also:
Dataset
,
NamesReader
Method Summary |
protected int[] |
convertCaseInt(java.util.Vector rawData,
AttributeSpecs[] names)
Convert case from a raw format. |
java.util.Vector |
open(java.lang.String fileName,
AttributeSpecs[] names)
Reads a data file with cases - comma delimited, no header. |
Dataset |
open(java.lang.String fileName,
java.lang.String className)
Reads a data file with cases - comma delimited, with header. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatasetReaderInt
public DatasetReaderInt()
open
public java.util.Vector open(java.lang.String fileName,
AttributeSpecs[] names)
throws java.lang.Exception
- Reads a data file with cases - comma delimited, no header. This function
is typically used to read files in c4.5 format, description of attributes
needs to be read from the '.names' first using
jbnc.dataset.NamesReader.open().
- Overrides:
open
in class DatasetReader
- Parameters:
names
- Descriptions of columns in the file.fileName
- Description of Parameter
- Returns:
- Vector of vectors representing cases. Each case
attribute is allocated in type defined by 'names' parameters.
- Throws:
java.lang.Exception
- Description of Exception
open
public Dataset open(java.lang.String fileName,
java.lang.String className)
throws java.lang.Exception
- Reads a data file with cases - comma delimited, with header. First line in
the file gives names of attributes (columns). In current implementation
the attributes are assumed to be discrete.
- Overrides:
open
in class DatasetReader
- Parameters:
fileName
- Name of the file to read data from.className
- Name of the attribute representing class. If it is
null, it is assumed that the last column represents class.
- Returns:
- Vector of vectors representing cases. Each case
attribute is allocated in type defined by 'names' parameters.
- Throws:
java.lang.Exception
- Description of Exception
convertCaseInt
protected int[] convertCaseInt(java.util.Vector rawData,
AttributeSpecs[] names)
throws java.lang.Exception
- Convert case from a raw format.
- Parameters:
rawData
- Description of Parameternames
- Description of Parameter
- Returns:
- Description of the Returned Value
- Throws:
java.lang.Exception
- Description of Exception