marf.Classification.RandomClassification
Class RandomClassification

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Classification.Classification
          extended by marf.Classification.RandomClassification.RandomClassification
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IClassification, IStorageManager

public class RandomClassification
extends Classification

Random Classification Module is for testing purposes.

This represents the bottom-line 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.21 2007/12/31 00:17:04 mokhov Exp $

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

Field Summary
 
Fields inherited from class marf.Classification.Classification
adFeatureVector, oFeatureExtraction, oResultSet, oTrainingSet
 
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
RandomClassification(IFeatureExtraction poFeatureExtraction)
          RandomClassification Constructor.
 
Method Summary
 void backSynchronizeObject()
          Must to be overridden by the modules that use object serialization with the generic implementation of restore().
 boolean classify(double[] padFeatureVector)
          Picks an ID at random.
 void dump()
          Dumps "training set" of IDs.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 Result getResult()
          Retrieves the classification result.
 void restore()
          Restores "training set" of IDs.
 java.lang.String toString()
          Returns string representation of the internals of this object.
 boolean train(double[] padFeatureVector)
          Simply stores incoming ID's to later pick one at random.
 
Methods inherited from class marf.Classification.Classification
classify, clone, getFeatureExtraction, getResultSet, getTrainingSetFilename, loadTrainingSet, setFeatureExtraction, train
 
Methods inherited from class marf.Storage.StorageManager
dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, getObjectToSerialize, hashCode, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomClassification

public RandomClassification(IFeatureExtraction poFeatureExtraction)
RandomClassification Constructor.

Parameters:
poFeatureExtraction - FeatureExtraction module reference
Method Detail

classify

public final boolean classify(double[] padFeatureVector)
                       throws ClassificationException
Picks an ID at random. In 0.3.0.6 the generic pipelined version of this API classify() was refactored into the Classification.

Parameters:
padFeatureVector - unused
Returns:
true
Throws:
ClassificationException
Since:
0.3.0.6

train

public final boolean train(double[] padFeatureVector)
                    throws ClassificationException
Simply stores incoming ID's to later pick one at random.

Specified by:
train in interface IClassification
Overrides:
train in class Classification
Parameters:
padFeatureVector - unused
Returns:
true if training was successful
Throws:
ClassificationException
Since:
0.3.0.6
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
See Also:
IStorageManager.DUMP_GZIP_BINARY, IStorageManager.DUMP_BINARY, StorageManager.dumpGzipBinary(), StorageManager.dumpCSV(), StorageManager.dumpBinary(), StorageManager.dumpXML(), StorageManager.dumpHTML(), StorageManager.dumpSQL(), StorageManager.backSynchronizeObject(), StorageManager.iCurrentDumpMode

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.
See Also:
IStorageManager.DUMP_GZIP_BINARY, IStorageManager.DUMP_BINARY, StorageManager.dumpGzipBinary(), StorageManager.dumpCSV(), StorageManager.dumpBinary(), StorageManager.dumpXML(), StorageManager.dumpHTML(), StorageManager.dumpSQL(), StorageManager.backSynchronizeObject(), StorageManager.iCurrentDumpMode

backSynchronizeObject

public void backSynchronizeObject()
Description copied from class: StorageManager
Must to be overridden by the modules that use object serialization with the generic implementation of restore(). By default this method is unimplemented.

Overrides:
backSynchronizeObject in class StorageManager
Since:
0.3.0.6
See Also:
StorageManager.backSynchronizeObject()

getResult

public Result getResult()
Retrieves the classification result.

Returns:
Result object
Since:
0.3.0.2

toString

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

Overrides:
toString in class StorageManager
Returns:
String
Since:
0.3.0.1
See Also:
Object.toString()

getMARFSourceCodeRevision

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

Returns:
revision string
Since:
0.3.0.2


SourceForge Logo