public class ScaledBytesFvTanimoto extends Object implements UnguardedDissimilarityCalculator<float[]>, Serializable
float[]
vectors.
Use with extreme care! This implementation wont check vector length equality.
Constructor and Description |
---|
ScaledBytesFvTanimoto() |
Modifier and Type | Method and Description |
---|---|
double |
denormalize(double dissimilarity)
Calculate raw value for a normalized dissimilarity value.
|
double |
dissimilarity(float[] target,
float[] query)
Compare dissimilarity of two objects.
|
double |
normalize(double rawValue)
Normalize dissimilarity value returned by
UnguardedDissimilarityCalculator.dissimilarity(java.lang.Object, java.lang.Object) . |
String |
toString() |
public double dissimilarity(float[] target, float[] query)
UnguardedDissimilarityCalculator
Note that implementations might not check even basic consistency of compared objects.
Implementations must return valid real numbers which are smaller than Double.MAX_VALUE
.
dissimilarity
in interface UnguardedDissimilarityCalculator<float[]>
target
- Target to comparequery
- Query to comparepublic double normalize(double rawValue)
UnguardedDissimilarityCalculator
UnguardedDissimilarityCalculator.dissimilarity(java.lang.Object, java.lang.Object)
.normalize
in interface UnguardedDissimilarityCalculator<float[]>
rawValue
- Raw dissimilarity valuepublic double denormalize(double dissimilarity)
UnguardedDissimilarityCalculator
denormalize
in interface UnguardedDissimilarityCalculator<float[]>
dissimilarity
- Normalized dissimilarity value