|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.Storage.StorageManager marf.Classification.Classification
public abstract class Classification
Abstract Classification Module.
A generic implementation of the IClassification
interface.
The derivatives must inherit from this class, and if they cannot,
they should implement IClassification
themselves.
Field Summary | |
---|---|
protected double[] |
adFeatureVector
Local reference to the array of features, either obtained from the feature extraction module or passed directly to train() or classify. |
protected IFeatureExtraction |
oFeatureExtraction
Reference to the enclosed FeatureExtraction object. |
protected ResultSet |
oResultSet
Classification result set. |
protected TrainingSet |
oTrainingSet
TrainingSet Container. |
Fields inherited from class marf.Storage.StorageManager |
---|
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename |
Fields inherited from interface marf.Classification.IClassification |
---|
MARF_INTERFACE_CODE_REVISION |
Fields inherited from interface marf.Storage.IStorageManager |
---|
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS |
Constructor Summary | |
---|---|
protected |
Classification(IFeatureExtraction poFeatureExtraction)
Generic Classification Constructor. |
Method Summary | |
---|---|
boolean |
classify()
Generic classification routine that assumes a presence of a valid non-null feature extraction module for pipeline operation. |
java.lang.Object |
clone()
Implements Cloneable interface for the Classification object. |
void |
dump()
Generic implementation of dump() to dump the TrainingSet. |
IFeatureExtraction |
getFeatureExtraction()
Retrieves the features source. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
ResultSet |
getResultSet()
Retrieves the enclosed result set. |
protected java.lang.String |
getTrainingSetFilename()
Constructs a global cluster file name for the TrainingSet. |
static TrainingSet |
loadTrainingSet(int piDumpMode,
java.lang.String pstrFilename)
Allows loading of the training sets for debugging and browsing purposes by external classes. |
void |
restore()
Generic implementation of restore() for TrainingSet. |
void |
setFeatureExtraction(IFeatureExtraction poFeatureExtraction)
Allows setting the features source. |
boolean |
train()
Generic training routine for building/updating mean vectors in the training set. |
boolean |
train(double[] padFeatureVector)
Generic training routine for building/updating mean vectors in the training set. |
Methods inherited from class marf.Storage.StorageManager |
---|
backSynchronizeObject, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, getObjectToSerialize, hashCode, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface marf.Classification.IClassification |
---|
classify, getResult |
Field Detail |
---|
protected IFeatureExtraction oFeatureExtraction
protected TrainingSet oTrainingSet
protected double[] adFeatureVector
train(double[])
,
IClassification.classify(double[])
protected ResultSet oResultSet
Constructor Detail |
---|
protected Classification(IFeatureExtraction poFeatureExtraction)
poFeatureExtraction
- FeatureExtraction module referenceMethod Detail |
---|
public boolean train() throws ClassificationException
TrainingSet
, it should call super.train();
train
in interface IClassification
true
if training was successful
(i.e. mean vector was updated); false
otherwise
ClassificationException
- if there was a problem while trainingTrainingSet
public boolean train(double[] padFeatureVector) throws ClassificationException
TrainingSet
, it should call super.train();
train
in interface IClassification
padFeatureVector
- feature vector to train on
true
if training was successful
(i.e. mean vector was updated); false
otherwise
ClassificationException
- if there was a problem while trainingTrainingSet
public boolean classify() throws ClassificationException
classify
in interface IClassification
true
if classification was successful; false
otherwise
ClassificationException
- if there was an error while classifyingIClassification.classify()
public void dump() throws StorageException
dump
in interface IStorageManager
dump
in class StorageManager
StorageException
- if there's a problem saving training set to diskIStorageManager.DUMP_GZIP_BINARY
,
IStorageManager.DUMP_BINARY
,
StorageManager.dumpGzipBinary()
,
StorageManager.dumpCSV()
,
StorageManager.dumpBinary()
,
StorageManager.dumpXML()
,
StorageManager.dumpHTML()
,
StorageManager.dumpSQL()
,
StorageManager.backSynchronizeObject()
,
StorageManager.iCurrentDumpMode
public void restore() throws StorageException
restore
in interface IStorageManager
restore
in class StorageManager
StorageException
- if there is a problem loading the training set from diskIStorageManager.DUMP_GZIP_BINARY
,
IStorageManager.DUMP_BINARY
,
StorageManager.dumpGzipBinary()
,
StorageManager.dumpCSV()
,
StorageManager.dumpBinary()
,
StorageManager.dumpXML()
,
StorageManager.dumpHTML()
,
StorageManager.dumpSQL()
,
StorageManager.backSynchronizeObject()
,
StorageManager.iCurrentDumpMode
public static TrainingSet loadTrainingSet(int piDumpMode, java.lang.String pstrFilename) throws StorageException
piDumpMode
- pstrFilename
-
StorageException
public ResultSet getResultSet()
getResultSet
in interface IClassification
protected java.lang.String getTrainingSetFilename()
Filename is constructed using fully-qualified class of either TrainingSet or a classifier name with global clustering info such as preprocessing and feature extraction methods, so that only that cluster can be reloaded after.
May be overridden by the derivatives when necessary.
public IFeatureExtraction getFeatureExtraction()
getFeatureExtraction
in interface IClassification
public void setFeatureExtraction(IFeatureExtraction poFeatureExtraction)
setFeatureExtraction
in interface IClassification
poFeatureExtraction
- the FeatureExtraction object to setpublic java.lang.Object clone()
clone
in class StorageManager
Object.clone()
public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |