marf.Classification.Distance
Class Distance

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

public abstract class Distance
extends Classification

Abstract Distance Classifier.

$Id: Distance.java,v 1.30 2005/12/24 19:47:37 mokhov Exp $

Since:
0.0.1
Version:
$Revision: 1.30 $
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
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()
          Classify the feature vector based on whatever distance() derivatives implement.
abstract  double distance(double[] paVector1, double[] paVector2)
          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
clone, dump, getFeatureExtraction, getResultSet, getTrainingSetFilename, restore, setFeatureExtraction, train
 
Methods inherited from class marf.Storage.StorageManager
backSynchronizeObject, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, 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()
                       throws ClassificationException
Classify the feature vector based on whatever distance() derivatives implement.

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.
See Also:
distance(double[], double[])

distance

public abstract double distance(double[] paVector1,
                                double[] paVector2)
Generic distance routine. To be overridden.

Parameters:
paVector1 - first vector for distance calculation
paVector2 - 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