|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.converters.AbstractLoader
weka.core.converters.AbstractFileLoader
weka.core.converters.CSVLoader
public class CSVLoader
Reads a source that is in comma separated or tab separated format. Assumes that the first row in the file determines the number of and names of the attributes.
Loader
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
FILE_EXTENSION
the file extension |
Constructor Summary | |
---|---|
CSVLoader()
default constructor |
Method Summary | |
---|---|
Instances |
getDataSet()
Return the full data set. |
java.lang.String |
getFileDescription()
Returns a description of the file type. |
java.lang.String |
getFileExtension()
Get the file extension used for arff files |
java.lang.String[] |
getFileExtensions()
Gets all the file extensions used for this type of file |
Instance |
getNextInstance(Instances structure)
CSVLoader is unable to process a data set incrementally. |
Instances |
getStructure()
Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances. |
java.lang.String |
globalInfo()
Returns a string describing this attribute evaluator |
static void |
main(java.lang.String[] args)
Main method. |
void |
setSource(java.io.File file)
Resets the Loader object and sets the source of the data set to be the supplied File object. |
void |
setSource(java.io.InputStream input)
Resets the Loader object and sets the source of the data set to be the supplied Stream object. |
Methods inherited from class weka.core.converters.AbstractFileLoader |
---|
reset, retrieveFile, runFileLoader, setFile |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String FILE_EXTENSION
Constructor Detail |
---|
public CSVLoader()
Method Detail |
---|
public java.lang.String getFileExtension()
getFileExtension
in interface FileSourcedConverter
public java.lang.String getFileDescription()
getFileDescription
in interface FileSourcedConverter
public java.lang.String[] getFileExtensions()
getFileExtensions
in interface FileSourcedConverter
public java.lang.String globalInfo()
public void setSource(java.io.InputStream input) throws java.io.IOException
setSource
in interface Loader
setSource
in class AbstractLoader
input
- the input stream
java.io.IOException
- if an error occurspublic void setSource(java.io.File file) throws java.io.IOException
setSource
in interface Loader
setSource
in class AbstractFileLoader
file
- the source file.
java.io.IOException
- if an error occurspublic Instances getStructure() throws java.io.IOException
getStructure
in interface Loader
getStructure
in class AbstractLoader
java.io.IOException
- if an error occurspublic Instances getDataSet() throws java.io.IOException
getDataSet
in interface Loader
getDataSet
in class AbstractLoader
java.io.IOException
- if there is no source or parsing failspublic Instance getNextInstance(Instances structure) throws java.io.IOException
getNextInstance
in interface Loader
getNextInstance
in class AbstractLoader
structure
- ignored
java.io.IOException
- always. CSVLoader is unable to process a data
set incrementally.public static void main(java.lang.String[] args)
args
- should contain the name of an input file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |