public class FloatsTanimoto extends Object implements UnguardedDissimilarityCalculator<Serializable>, Serializable
float[]
vectors.
Use with extreme care! This implementation wont check vector length equality.
Constructor and Description |
---|
FloatsTanimoto() |
Modifier and Type | Method and Description |
---|---|
double |
denormalize(double dissimilarity)
Calculate raw value for a normalized dissimilarity value.
|
double |
dissimilarity(Serializable t,
Serializable q)
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(Serializable t, Serializable q)
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<Serializable>
t
- Target to compareq
- Query to comparepublic double normalize(double rawValue)
UnguardedDissimilarityCalculator
UnguardedDissimilarityCalculator.dissimilarity(java.lang.Object, java.lang.Object)
.normalize
in interface UnguardedDissimilarityCalculator<Serializable>
rawValue
- Raw dissimilarity valuepublic double denormalize(double dissimilarity)
UnguardedDissimilarityCalculator
denormalize
in interface UnguardedDissimilarityCalculator<Serializable>
dissimilarity
- Normalized dissimilarity value