marf.Classification.Distance
Class Distance
java.lang.Object
marf.Storage.StorageManager
marf.Classification.Classification
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
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 |
Distance
public Distance(IFeatureExtraction poFeatureExtraction)
- Distance Constructor.
- Parameters:
poFeatureExtraction
- FeatureExtraction module reference
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 calculationpadVector2
- 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