| |
|
| java.lang.Object weka.classifiers.EnsembleLibrary
All known Subclasses: weka.classifiers.meta.ensembleSelection.EnsembleSelectionLibrary,
EnsembleLibrary | public class EnsembleLibrary implements Serializable(Code) | | This class represents a library of classifiers. This class
follows the factory design pattern of creating LibraryModels
when asked. It also has the methods necessary for saving
and loading models from lists.
author: Robert Jung (mrbobjung@gmail.com) version: $Revision: 1.1 $ |
FLAT_FILE_EXTENSION | final public static String FLAT_FILE_EXTENSION(Code) | | The flat file extension for model list files
|
XML_FILE_EXTENSION | final public static String XML_FILE_EXTENSION(Code) | | The default file extension for model list files
|
m_Models | public TreeSet m_Models(Code) | | the set of classifiers that constitute the library
|
EnsembleLibrary | public EnsembleLibrary()(Code) | | Constructor is responsible for initializing the data
structure hoilding all of the models
|
addModel | public void addModel(EnsembleLibraryModel model)(Code) | | adds a LibraryModel to the Library
Parameters: model - the model to add |
addModel | public void addModel(String modelString)(Code) | | adds a LibraryModel to the Library
Parameters: modelString - the model to add |
addPropertyChangeListener | public void addPropertyChangeListener(PropertyChangeListener listener)(Code) | | Adds an object to the list of those that wish to be informed when the
library changes.
Parameters: listener - a new listener to add to the list |
clearModels | public void clearModels()(Code) | | removes all models from the current library
|
createModel | public EnsembleLibraryModel createModel(Classifier classifier)(Code) | | creates a LibraryModel from a string representing the command
line invocation
Parameters: classifier - the classifier to create a model from the generated model |
createModel | public EnsembleLibraryModel createModel(String modelString)(Code) | | This method takes a String argument defining a classifier and
uses it to create a base Classifier.
Parameters: modelString - the classifier string the generated model |
getModels | public TreeSet getModels()(Code) | | getter for the set of models in this library
the current models |
loadLibrary | public static void loadLibrary(File selectedFile, JComponent dialogParent, EnsembleLibrary library)(Code) | | Loads and returns a library from the specified file
Parameters: selectedFile - the file to load from Parameters: dialogParent - the parent component Parameters: library - will contain the data after loading |
loadLibrary | public static void loadLibrary(File selectedFile, EnsembleLibrary library) throws Exception(Code) | | This method takes a model list file and a library object as arguments and
Instantiates all of the models in the library list file. It is assumed
that the passed library was an associated working directory and can take
care of creating the model objects itself.
Parameters: selectedFile - the file to load Parameters: library - the library throws: Exception - if something goes wrong |
loadLibrary | public static void loadLibrary(InputStream stream, EnsembleLibrary library) throws Exception(Code) | | This method takes an XML input stream and a library object as arguments
and Instantiates all of the models in the stream. It is assumed
that the passed library was an associated working directory and can take
care of creating the model objects itself.
Parameters: stream - the XML stream to load Parameters: library - the library throws: Exception - if something goes wrong |
removeModel | public void removeModel(EnsembleLibraryModel model)(Code) | | removes a LibraryModel from the Library
Parameters: model - the model to remove |
saveLibrary | public static void saveLibrary(File selectedFile, EnsembleLibrary library, JComponent dialogParent)(Code) | | Saves the given library in the specified file. This saves only
the specification of the models as a model list.
Parameters: selectedFile - the file to save to Parameters: library - the library to save Parameters: dialogParent - the component parent |
setModels | public void setModels(TreeSet models)(Code) | | setter for the set of models in this library
Parameters: models - the models to use |
size | public int size()(Code) | | Returns the number of models in the ensemble library
the number of models |
|
|
|