|
||||||||||
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.LibSVMLoader
public class LibSVMLoader
Reads a source that is in libsvm format.
For more information about libsvm see:
http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Loader
,
Serialized FormField Summary | |
---|---|
static String |
FILE_EXTENSION
the file extension. |
Fields inherited from class weka.core.converters.AbstractFileLoader |
---|
FILE_EXTENSION_COMPRESSED |
Fields inherited from interface weka.core.converters.Loader |
---|
BATCH, INCREMENTAL, NONE |
Constructor Summary | |
---|---|
LibSVMLoader()
|
Method Summary | |
---|---|
Instances |
getDataSet()
Return the full data set. |
String |
getFileDescription()
Returns a description of the file type. |
String |
getFileExtension()
Get the file extension used for libsvm files. |
String[] |
getFileExtensions()
Gets all the file extensions used for this type of file. |
Instance |
getNextInstance(Instances structure)
LibSVmLoader is unable to process a data set incrementally. |
String |
getRevision()
Returns the revision string. |
Instances |
getStructure()
Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances. |
String |
globalInfo()
Returns a string describing this Loader. |
static void |
main(String[] args)
Main method. |
void |
reset()
Resets the Loader ready to read a new data set. |
String |
retrieveURL()
Return the current url. |
void |
setSource(InputStream in)
Resets the Loader object and sets the source of the data set to be the supplied InputStream. |
void |
setSource(URL url)
Resets the Loader object and sets the source of the data set to be the supplied url. |
void |
setURL(String url)
Set the url to load from. |
Methods inherited from class weka.core.converters.AbstractFileLoader |
---|
getUseRelativePath, retrieveFile, runFileLoader, setEnvironment, setFile, setSource, setUseRelativePath, useRelativePathTipText |
Methods inherited from class weka.core.converters.AbstractLoader |
---|
setRetrieval |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String FILE_EXTENSION
Constructor Detail |
---|
public LibSVMLoader()
Method Detail |
---|
public String globalInfo()
public String getFileExtension()
getFileExtension
in interface FileSourcedConverter
public String[] getFileExtensions()
getFileExtensions
in interface FileSourcedConverter
public String getFileDescription()
getFileDescription
in interface FileSourcedConverter
public void reset() throws IOException
reset
in interface Loader
reset
in class AbstractFileLoader
IOException
- if something goes wrongpublic void setSource(URL url) throws IOException
url
- the source url.
IOException
- if an error occurspublic void setURL(String url) throws IOException
setURL
in interface URLSourcedLoader
url
- the url to load from
IOException
- if the url can't be set.public String retrieveURL()
retrieveURL
in interface URLSourcedLoader
public void setSource(InputStream in) throws IOException
setSource
in interface Loader
setSource
in class AbstractLoader
in
- the source InputStream.
IOException
- if initialization of reader fails.public Instances getStructure() throws IOException
getStructure
in interface Loader
getStructure
in class AbstractLoader
IOException
- if an error occurspublic Instances getDataSet() throws IOException
getDataSet
in interface Loader
getDataSet
in class AbstractLoader
IOException
- if there is no source or parsing failspublic Instance getNextInstance(Instances structure) throws IOException
getNextInstance
in interface Loader
getNextInstance
in class AbstractLoader
structure
- ignored
IOException
- always. LibSVMLoader is unable to process a
data set incrementally.public String getRevision()
getRevision
in interface RevisionHandler
public static void main(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 |