marf.Classification.Distance
Class Distance

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Classification.Classification
          extended by marf.Classification.Distance.Distance
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IClassification, IStorageManager
Direct Known Subclasses:
ChebyshevDistance, DiffDistance, EuclideanDistance, HammingDistance, MahalanobisDistance, MinkowskiDistance

public abstract class Distance
extends Classification

Abstract Distance Classifier.

$Id: Distance.java,v 1.36 2008/02/05 22:13:30 mokhov Exp $

Since:
0.0.1
Version:
$Revision: 1.36 $
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
Distance(IFeatureExtraction poFeatureExtraction)
          Distance Constructor.
 
Method Summary
 boolean classify(double[] padFeatureVector)
          Classify the feature vector based on whatever distance() derivatives implement.
abstract  double distance(double[] padVector1, double[] padVector2)
          Generic distance routine.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 Result getResult()
          Retrieves the minimum-distance classification result.
 
Methods inherited from class marf.Classification.Classification
classify, clone, dump, getFeatureExtraction, getResultSet, getTrainingSetFilename, loadTrainingSet, restore, setFeatureExtraction, train, train
 
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
 

Constructor Detail

Distance

public Distance(IFeatureExtraction poFeatureExtraction)
Distance Constructor.

Parameters:
poFeatureExtraction - FeatureExtraction module reference
Method Detail

classify

public final boolean classify(double[] padFeatureVector)
                       throws ClassificationException
Classify the feature vector based on whatever distance() derivatives implement. In 0.3.0.6 the generic pipelined version of this API classify() was refactored into the Classification.

Parameters:
padFeatureVector - vector of features to compare with the stored ones
Returns:
true if classification successful whatever that means
Throws:
ClassificationException - if sanity checks fail. The checks include verifying nullness of the mean vector and its length compared to the feature vector or encapsulation of StorageException when dumping/restoring.
Since:
0.3.0.6
See Also:
distance(double[], double[]), Classification.classify()

distance

public abstract double distance(double[] padVector1,
                                double[] padVector2)
Generic distance routine. To be overridden.

Parameters:
padVector1 - first vector for distance calculation
padVector2 - second vector for distance calculation
Returns:
distance between the two vectors

getResult

public Result getResult()
Retrieves the minimum-distance classification result.

Returns:
Result object
Since:
0.3.0

getMARFSourceCodeRevision

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

Returns:
revision string
Since:
0.3.0.2


SourceForge Logo