marf.Classification.RandomClassification
Class RandomClassification

java.lang.Object
  |
  +--marf.Storage.StorageManager
        |
        +--marf.Classification.Classification
              |
              +--marf.Classification.RandomClassification.RandomClassification
All Implemented Interfaces:
IStorageManager, java.io.Serializable

public class RandomClassification
extends Classification

Random Classification Module is for testing purposes.

This represents the bottomline of the classification results. All the other modules should be better than this 99% of the time. If they are not, debug them.

$Id: RandomClassification.java,v 1.10 2005/05/30 11:59:48 mokhov Exp $

Since:
0.2.0
Version:
$Revision: 1.10 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class marf.Classification.Classification
oFeatureExtraction, oResultSet, oTrainingSet
 
Fields inherited from class marf.Storage.StorageManager
iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, INTERFACE_CODE_REVISION, sastrExtensionsMap
 
Constructor Summary
RandomClassification(marf.FeatureExtraction.FeatureExtraction poFeatureExtraction)
          RandomClassification Constructor.
 
Method Summary
 boolean classify()
          Picks an ID at random.
 void dump()
          Dumps "training set" of IDs.
 marf.Storage.Result getResult()
          Retrieves the classification result.
static java.lang.String getRevision()
          Retrieves class' revision.
 void restore()
          Restores "training set" of IDs.
 java.lang.String toString()
          Returns string representation of the internals of this object.
 boolean train()
          Simply stores incoming ID's.
 
Methods inherited from class marf.Classification.Classification
getResultSet, getTrainingSetFilename
 
Methods inherited from class marf.Storage.StorageManager
backSynchronizeObject, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomClassification

public RandomClassification(marf.FeatureExtraction.FeatureExtraction poFeatureExtraction)
RandomClassification Constructor.

Parameters:
poFeatureExtraction - FeatureExtraction module reference
Method Detail

classify

public final boolean classify()
                       throws ClassificationException
Picks an ID at random.

Specified by:
classify in class Classification
Returns:
true
Throws:
ClassificationException

train

public final boolean train()
                    throws ClassificationException
Simply stores incoming ID's.

Overrides:
train in class Classification
Returns:
true
Throws:
ClassificationException
See Also:
TrainingSet

dump

public final void dump()
                throws StorageException
Dumps "training set" of IDs.

Specified by:
dump in interface IStorageManager
Overrides:
dump in class Classification
Throws:
StorageException

restore

public final void restore()
                   throws StorageException
Restores "training set" of IDs.

Specified by:
restore in interface IStorageManager
Overrides:
restore in class Classification
Throws:
StorageException - if there was an error loading the data file.

getResult

public marf.Storage.Result getResult()
Retrieves the classification result.

Specified by:
getResult in class Classification
Returns:
Result object
Since:
0.3.0

toString

public java.lang.String toString()
Returns string representation of the internals of this object.

Overrides:
toString in class java.lang.Object
Returns:
String
Since:
0.3.0

getRevision

public static java.lang.String getRevision()
Retrieves class' revision.

Returns:
revision string
Since:
0.3.0