public class EnsembleLibrary
extends java.lang.Object
implements java.io.Serializable, weka.core.RevisionHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FLAT_FILE_EXTENSION
The flat file extension for model list files
|
java.util.TreeSet |
m_Models
the set of classifiers that constitute the library
|
static java.lang.String |
XML_FILE_EXTENSION
The default file extension for model list files
|
Constructor and Description |
---|
EnsembleLibrary()
Constructor is responsible for initializing the data
structure hoilding all of the models
|
Modifier and Type | Method and Description |
---|---|
void |
addModel(EnsembleLibraryModel model)
adds a LibraryModel to the Library
|
void |
addModel(java.lang.String modelString)
adds a LibraryModel to the Library
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds an object to the list of those that wish to be informed when the
library changes.
|
void |
clearModels()
removes all models from the current library
|
EnsembleLibraryModel |
createModel(weka.classifiers.Classifier classifier)
creates a LibraryModel from a string representing the command
line invocation
|
EnsembleLibraryModel |
createModel(java.lang.String modelString)
This method takes a String argument defining a classifier and
uses it to create a base Classifier.
|
java.util.TreeSet |
getModels()
getter for the set of models in this library
|
java.lang.String |
getRevision()
Returns the revision string.
|
static void |
loadLibrary(java.io.File selectedFile,
EnsembleLibrary library)
This method takes a model list file and a library object as arguments and
Instantiates all of the models in the library list file.
|
static void |
loadLibrary(java.io.File selectedFile,
javax.swing.JComponent dialogParent,
EnsembleLibrary library)
Loads and returns a library from the specified file
|
static void |
loadLibrary(java.io.InputStream stream,
EnsembleLibrary library)
This method takes an XML input stream and a library object as arguments
and Instantiates all of the models in the stream.
|
void |
removeModel(EnsembleLibraryModel model)
removes a LibraryModel from the Library
|
static void |
saveLibrary(java.io.File selectedFile,
EnsembleLibrary library,
javax.swing.JComponent dialogParent)
Saves the given library in the specified file.
|
void |
setModels(java.util.TreeSet models)
setter for the set of models in this library
|
int |
size()
Returns the number of models in the ensemble library
|
public static final java.lang.String XML_FILE_EXTENSION
public static final java.lang.String FLAT_FILE_EXTENSION
public java.util.TreeSet m_Models
public EnsembleLibrary()
public int size()
public void addModel(EnsembleLibraryModel model)
model
- the model to addpublic void addModel(java.lang.String modelString)
modelString
- the model to addpublic void removeModel(EnsembleLibraryModel model)
model
- the model to removepublic EnsembleLibraryModel createModel(weka.classifiers.Classifier classifier)
classifier
- the classifier to create a model frompublic EnsembleLibraryModel createModel(java.lang.String modelString)
modelString
- the classifier stringpublic java.util.TreeSet getModels()
public void setModels(java.util.TreeSet models)
models
- the models to usepublic void clearModels()
public static void loadLibrary(java.io.File selectedFile, javax.swing.JComponent dialogParent, EnsembleLibrary library)
selectedFile
- the file to load fromdialogParent
- the parent componentlibrary
- will contain the data after loadingpublic static void loadLibrary(java.io.File selectedFile, EnsembleLibrary library) throws java.lang.Exception
selectedFile
- the file to loadlibrary
- the libraryjava.lang.Exception
- if something goes wrongpublic static void loadLibrary(java.io.InputStream stream, EnsembleLibrary library) throws java.lang.Exception
stream
- the XML stream to loadlibrary
- the libraryjava.lang.Exception
- if something goes wrongpublic static void saveLibrary(java.io.File selectedFile, EnsembleLibrary library, javax.swing.JComponent dialogParent)
selectedFile
- the file to save tolibrary
- the library to savedialogParent
- the component parentpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- a new listener to add to the listpublic java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler