|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
weka.gui.beans.SerializedModelSaver
public class SerializedModelSaver
A bean that saves serialized models
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary | |
|---|---|
static int |
BINARY
|
static String |
FILE_EXTENSION
the extension for serialized models (binary Java serialization) |
static int |
KOMLV
|
static ArrayList<Tag> |
s_fileFormatsAvailable
Available file formats. |
static int |
XSTREAM
|
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SerializedModelSaver()
Constructor. |
|
| Method Summary | |
|---|---|
void |
acceptClassifier(BatchClassifierEvent ce)
Accept and save a batch trained classifier. |
void |
acceptClassifier(IncrementalClassifierEvent ce)
Accept and save an incrementally trained classifier. |
void |
acceptClusterer(BatchClustererEvent ce)
Accept and save a batch trained clusterer. |
boolean |
connectionAllowed(EventSetDescriptor esd)
Returns true if, at this time, the object will accept a connection according to the supplied EventSetDescriptor. |
boolean |
connectionAllowed(String eventName)
Returns true if, at this time, the object will accept a connection according to the supplied event name. |
void |
connectionNotification(String eventName,
Object source)
Notify this object that it has been registered as a listener with a source with respect to the supplied event name. |
void |
disconnectionNotification(String eventName,
Object source)
Notify this object that it has been deregistered as a listener with a source with respect to the supplied event name. |
String |
getCustomName()
Get the custom (descriptive) name for this bean (if one has been set) |
File |
getDirectory()
Get the directory that the model(s) will be saved into |
Tag |
getFileFormat()
Get the file format to use for saving. |
boolean |
getIncludeRelationName()
Get whether the relation name of the training data used to create the model is to be included in the filename of the serialized model. |
String |
getPrefix()
Get the prefix to prepend to the model file names. |
boolean |
getUseRelativePath()
Get whether to use relative paths for the directory. |
BeanVisual |
getVisual()
Get the visual being used by this data source. |
String |
globalInfo()
Global info for this bean. |
boolean |
isBusy()
Returns true if. |
static void |
saveBinary(File saveTo,
Object model,
Instances header)
Save a model in binary form. |
static void |
saveKOML(File saveTo,
Object model,
Instances header)
Save a model in KOML deep object serialized XML form. |
static void |
saveXStream(File saveTo,
Object model,
Instances header)
Save a model in XStream deep object serialized XML form. |
void |
setCustomName(String name)
Set a custom (descriptive) name for this bean |
void |
setDirectory(File d)
Set the directory that the model(s) will be saved into. |
void |
setEnvironment(Environment env)
Set environment variables to use. |
void |
setFileFormat(Tag ff)
Set the file format to use for saving. |
void |
setIncludeRelationName(boolean rn)
Set whether the relation name of the training data used to create the model should be included as part of the filename for the serialized model. |
void |
setLog(Logger logger)
Set a log for this bean. |
void |
setPrefix(String p)
Set the prefix to prepend to the model file names. |
void |
setUseRelativePath(boolean rp)
Set whether to use relative paths for the directory. |
void |
setVisual(BeanVisual newVisual)
Set the visual for this data source. |
void |
stop()
Stop any processing that the bean might be doing. |
void |
useDefaultVisual()
Use the default images for this bean. |
Tag |
validateFileFormat(Tag ff)
Validate the file format. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int BINARY
public static final int KOMLV
public static final int XSTREAM
public static final String FILE_EXTENSION
public static ArrayList<Tag> s_fileFormatsAvailable
| Constructor Detail |
|---|
public SerializedModelSaver()
| Method Detail |
|---|
public void setCustomName(String name)
setCustomName in interface BeanCommonname - the name to usepublic String getCustomName()
getCustomName in interface BeanCommonpublic void useDefaultVisual()
useDefaultVisual in interface Visiblepublic void setVisual(BeanVisual newVisual)
setVisual in interface VisiblenewVisual - a BeanVisual valuepublic BeanVisual getVisual()
getVisual in interface VisibleBeanVisual valuepublic boolean connectionAllowed(EventSetDescriptor esd)
connectionAllowed in interface BeanCommonesd - the EventSetDescriptor
public boolean connectionAllowed(String eventName)
connectionAllowed in interface BeanCommoneventName - the event
public void connectionNotification(String eventName,
Object source)
connectionNotification in interface BeanCommoneventName - the eventsource - the source with which this object has been registered as
a listener
public void disconnectionNotification(String eventName,
Object source)
disconnectionNotification in interface BeanCommoneventName - the eventsource - the source with which this object has been registered as
a listenerpublic void setLog(Logger logger)
setLog in interface BeanCommonlogger - a weka.gui.Logger valuepublic void stop()
stop in interface BeanCommonpublic boolean isBusy()
isBusy in interface BeanCommonpublic void acceptClusterer(BatchClustererEvent ce)
acceptClusterer in interface BatchClustererListenerce - a BatchClassifierEvent valuepublic void acceptClassifier(IncrementalClassifierEvent ce)
acceptClassifier in interface IncrementalClassifierListenerce - the BatchClassifierEvent containing the classifierpublic void acceptClassifier(BatchClassifierEvent ce)
acceptClassifier in interface BatchClassifierListenerce - the BatchClassifierEvent containing the classifier
public static void saveBinary(File saveTo,
Object model,
Instances header)
throws IOException
saveTo - the file name to save tomodel - the model to saveheader - the header of the data that was used to train the model (optional)
IOException
public static void saveKOML(File saveTo,
Object model,
Instances header)
throws Exception
saveTo - the file name to save tomodel - the model to saveheader - the header of the data that was used to train the model (optional)
Exception
public static void saveXStream(File saveTo,
Object model,
Instances header)
throws Exception
saveTo - the file name to save tomodel - the model to saveheader - the header of the data that was used to train the model (optional)
Exceptionpublic File getDirectory()
public void setDirectory(File d)
d - the directory to save topublic void setUseRelativePath(boolean rp)
rp - true if relative paths are to be usedpublic boolean getUseRelativePath()
public void setIncludeRelationName(boolean rn)
rn - true if the relation name should be included
in the file namepublic boolean getIncludeRelationName()
public String getPrefix()
public void setPrefix(String p)
p - the prefix to prependpublic String globalInfo()
public void setFileFormat(Tag ff)
ff - the file format to usepublic Tag getFileFormat()
public Tag validateFileFormat(Tag ff)
ff - the current file format to validatepublic void setEnvironment(Environment env)
setEnvironment in interface EnvironmentHandlerenv - the environment variables to
use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||