Package weka.core.converters
Class CNTKLoader
- java.lang.Object
-
- weka.core.converters.AbstractLoader
-
- weka.core.converters.AbstractFileLoader
-
- weka.core.converters.CNTKLoader
-
- All Implemented Interfaces:
Serializable
,weka.core.converters.BatchConverter
,weka.core.converters.FileSourcedConverter
,weka.core.converters.Loader
,weka.core.EnvironmentHandler
,weka.core.OptionHandler
,weka.core.RevisionHandler
public class CNTKLoader extends weka.core.converters.AbstractFileLoader implements weka.core.converters.BatchConverter, weka.core.OptionHandler
Reads CNTK data files in text format.
Valid options are:-D <value> Whether to print additional debug information to the console. (default: off)
-class-group <value> The group representing the class attribute. (default: )
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_ClassGroup
the group that represents the class attribute.protected weka.core.Instances
m_Data
the actual data.protected boolean
m_Debug
whether to print some debug informationprotected File
m_sourceFile
Holds the source of the data set.protected weka.core.Instances
m_structure
Holds the determined structure (header) of the data set.
-
Constructor Summary
Constructors Constructor Description CNTKLoader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
classGroupTipText()
the tip text for this propertyString
debugTipText()
the tip text for this propertyString
getClassGroup()
Returns the name of the group representing the class attribute.weka.core.Instances
getDataSet()
Return the full data set.boolean
getDebug()
Gets whether additional debug information is printed.String
getDefaultClassGroup()
Returns the default name of the group representing the class attribute.String
getFileDescription()
Get a one line description of the type of fileString
getFileExtension()
Get the file extension used for this type of fileString[]
getFileExtensions()
Gets all the file extensions used for this type of fileweka.core.Instance
getNextInstance(weka.core.Instances structure)
CNTKLoader is unable to process a data set incrementally.String[]
getOptions()
Gets the settingString
getRevision()
Returns the revision string.weka.core.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 suitable for the GUI.Enumeration
listOptions()
Lists the available optionsstatic void
main(String[] args)
Main method.void
reset()
Resets the loader ready to read a new data setvoid
setClassGroup(String value)
Sets the name of the group representing the class attribute.void
setDebug(boolean value)
Sets whether to print some debug information.void
setOptions(String[] options)
Parses a given list of options.void
setSource(File file)
Resets the Loader object and sets the source of the data set to be the supplied File object.-
Methods inherited from class weka.core.converters.AbstractFileLoader
getUseRelativePath, makeOptionStr, retrieveFile, runFileLoader, setEnvironment, setFile, setUseRelativePath, useRelativePathTipText
-
-
-
-
Field Detail
-
m_structure
protected weka.core.Instances m_structure
Holds the determined structure (header) of the data set.
-
m_Data
protected weka.core.Instances m_Data
the actual data.
-
m_sourceFile
protected File m_sourceFile
Holds the source of the data set.
-
m_Debug
protected boolean m_Debug
whether to print some debug information
-
m_ClassGroup
protected String m_ClassGroup
the group that represents the class attribute.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string suitable for the GUI.- Returns:
- the string
-
listOptions
public Enumeration listOptions()
Lists the available options- Specified by:
listOptions
in interfaceweka.core.OptionHandler
- Returns:
- an enumeration of the available options
-
setOptions
public void setOptions(String[] options) throws Exception
Parses a given list of options.- Specified by:
setOptions
in interfaceweka.core.OptionHandler
- Parameters:
options
- the options- Throws:
Exception
- if options cannot be set
-
getOptions
public String[] getOptions()
Gets the setting- Specified by:
getOptions
in interfaceweka.core.OptionHandler
- Returns:
- the current setting
-
setDebug
public void setDebug(boolean value)
Sets whether to print some debug information.- Parameters:
value
- if true additional debug information will be printed.
-
getDebug
public boolean getDebug()
Gets whether additional debug information is printed.- Returns:
- true if additional debug information is printed
-
debugTipText
public String debugTipText()
the tip text for this property- Returns:
- the tip text
-
getDefaultClassGroup
public String getDefaultClassGroup()
Returns the default name of the group representing the class attribute.- Returns:
- the default
-
setClassGroup
public void setClassGroup(String value)
Sets the name of the group representing the class attribute.- Parameters:
value
- the name
-
getClassGroup
public String getClassGroup()
Returns the name of the group representing the class attribute.- Returns:
- the name
-
classGroupTipText
public String classGroupTipText()
the tip text for this property- Returns:
- the tip text
-
getFileExtension
public String getFileExtension()
Get the file extension used for this type of file- Specified by:
getFileExtension
in interfaceweka.core.converters.FileSourcedConverter
- Returns:
- the file extension
-
getFileExtensions
public String[] getFileExtensions()
Gets all the file extensions used for this type of file- Specified by:
getFileExtensions
in interfaceweka.core.converters.FileSourcedConverter
- Returns:
- the file extensions
-
getFileDescription
public String getFileDescription()
Get a one line description of the type of file- Specified by:
getFileDescription
in interfaceweka.core.converters.FileSourcedConverter
- Returns:
- a description of the file type
-
reset
public void reset() throws IOException
Resets the loader ready to read a new data set- Specified by:
reset
in interfaceweka.core.converters.Loader
- Overrides:
reset
in classweka.core.converters.AbstractFileLoader
- Throws:
IOException
-
setSource
public void setSource(File file) throws IOException
Resets the Loader object and sets the source of the data set to be the supplied File object.- Specified by:
setSource
in interfaceweka.core.converters.Loader
- Overrides:
setSource
in classweka.core.converters.AbstractFileLoader
- Parameters:
file
- the source file.- Throws:
IOException
- if an error occurs
-
getStructure
public weka.core.Instances getStructure() throws IOException
Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances.- Specified by:
getStructure
in interfaceweka.core.converters.Loader
- Specified by:
getStructure
in classweka.core.converters.AbstractLoader
- Returns:
- the structure of the data set as an empty set of Instances
- Throws:
IOException
- if an error occurs
-
getDataSet
public weka.core.Instances getDataSet() throws IOException
Return the full data set. If the structure hasn't yet been determined by a call to getStructure then method should do so before processing the rest of the data set.- Specified by:
getDataSet
in interfaceweka.core.converters.Loader
- Specified by:
getDataSet
in classweka.core.converters.AbstractLoader
- Returns:
- the structure of the data set as an empty set of Instances
- Throws:
IOException
- if there is no source or parsing fails
-
getNextInstance
public weka.core.Instance getNextInstance(weka.core.Instances structure) throws IOException
CNTKLoader is unable to process a data set incrementally.- Specified by:
getNextInstance
in interfaceweka.core.converters.Loader
- Specified by:
getNextInstance
in classweka.core.converters.AbstractLoader
- Parameters:
structure
- ignored- Returns:
- never returns without throwing an exception
- Throws:
IOException
- always. AdamsCsvLoader is unable to process a data set incrementally.
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceweka.core.RevisionHandler
- Returns:
- the revision
-
main
public static void main(String[] args)
Main method.- Parameters:
args
- should contain the name of an input file.
-
-