public class ObjectFeatureSetMinNumOfSimilar extends ObjectFeatureSet
ObjectFeatureSet
. The result is inversed so it
can be used as a distance within [0,1].
In particular, it chooses the smaller (SM) of the feature sets (this and the other object) and then it
finds for each feature in SM the most similar feature to it from the other set. Based on these features distance,
1 (very similar) or 0.5 (similar) is added to a total sum. Finally, the total sum is normalized by dividing by size of SM.
The resulting distance is 1f - the normalized sum.
CAVEAT: This distance may not be a metric!!! It may break triangle inequality. Please check it and change this warning appropriately.LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
static SequenceMatchingCost |
defaultCost
Default defaultCost
|
objects, QUANTIZED_FEATURES_SPLIT_CHARACTER
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Constructor and Description |
---|
ObjectFeatureSetMinNumOfSimilar() |
ObjectFeatureSetMinNumOfSimilar(BinaryInput input,
BinarySerializator serializator) |
ObjectFeatureSetMinNumOfSimilar(java.io.BufferedReader stream) |
ObjectFeatureSetMinNumOfSimilar(java.io.BufferedReader stream,
java.util.Map<java.lang.String,? extends java.io.Serializable> additionalParameters) |
ObjectFeatureSetMinNumOfSimilar(ObjectFeatureSet superSet) |
ObjectFeatureSetMinNumOfSimilar(ObjectFeatureSet supSet,
float minX,
float maxX,
float minY,
float maxY) |
ObjectFeatureSetMinNumOfSimilar(java.lang.String locatorURI,
java.util.Collection<? extends ObjectFeature> objects) |
Modifier and Type | Method and Description |
---|---|
protected float |
getDistanceImpl(LocalAbstractObject o,
float distThreshold)
The actual implementation of the metric function (see
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject) for full explanation). |
float |
getMaxDistance()
Returns a maximal possible distance for this class.
|
addObject, binarySerialize, clearSurplusData, clone, clone, cloneRandomlyModify, containsParameter, dataEquals, dataHashCode, filterFeatures, getBinarySize, getObject, getObjectCount, getParameter, getParameter, getParameter, getParameterCount, getParameterMap, getParameterNames, getRequiredParameter, getRequiredParameter, getSaveObjectsClass, getSize, getStringData, iterator, readObject, readObject, toString, writeData
clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, getNormDistance, getPrecomputedDistance, getPrecomputedDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, isDistanceCompatible, parseObjectComment, peekNextChar, readAttributesFromStream, readObjectComments, readObjectCommentsWithoutData, unchainFilter, write, write, writeAttributesToStream, writeObjectComment
clone, getLocatorURI, getNoDataObject, getObjectKey, getObjectKey, getObjectLocatorURI, setObjectKey
public static SequenceMatchingCost defaultCost
public ObjectFeatureSetMinNumOfSimilar()
public ObjectFeatureSetMinNumOfSimilar(java.lang.String locatorURI, java.util.Collection<? extends ObjectFeature> objects)
public ObjectFeatureSetMinNumOfSimilar(ObjectFeatureSet supSet, float minX, float maxX, float minY, float maxY)
public ObjectFeatureSetMinNumOfSimilar(ObjectFeatureSet superSet)
public ObjectFeatureSetMinNumOfSimilar(java.io.BufferedReader stream) throws java.io.IOException
java.io.IOException
public ObjectFeatureSetMinNumOfSimilar(java.io.BufferedReader stream, java.util.Map<java.lang.String,? extends java.io.Serializable> additionalParameters) throws java.io.IOException
java.io.IOException
public ObjectFeatureSetMinNumOfSimilar(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
java.io.IOException
protected float getDistanceImpl(LocalAbstractObject o, float distThreshold)
LocalAbstractObject
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject)
for full explanation).
The implementation should not increment distanceComputations statistics.getDistanceImpl
in class LocalAbstractObject
o
- the object to compute distance todistThreshold
- the threshold value on the distancepublic float getMaxDistance()
LocalAbstractObject
LocalAbstractObject.MAX_DISTANCE
.getMaxDistance
in class LocalAbstractObject