public class NormalizedL1Comparator extends ParameterLessComparisonBasedSkipExtendedComparator<double[],double[]>
Constructor and Description |
---|
NormalizedL1Comparator(double[] deleteComparison,
double[] insertComparison) |
NormalizedL1Comparator(double[] deleteComparison,
double[] insertComparison,
double[] skipDeleteComparison,
double[] skipInsertComparison) |
NormalizedL1Comparator(int dimensions) |
NormalizedL1Comparator(int dimensions,
double comparisonValue) |
Modifier and Type | Method and Description |
---|---|
double |
actualCompare(double[] a,
double[] b)
This has to return a distance between a and b with the following restrictions:
The return value has to lie between 0 and 1.
1 means maximum dissimilarity between a and b.
0 means maximum similarity between a and b (especially it should be true that a = b
implies a zero distance).
distance(a,b) should be equal or at least close to distance(b,a)
|
static double |
norm(double[] v)
Calculates the L1 norm/Manhattan norm of the given input vector.
|
computeComparisonGradient, getComparisonParameters, getNumberOfComparisonParameters, setComparisonParameters
compare, computeGradient, equals, hashCode
getNumberOfParameters, getParameters, hasCoherentReplacementCost, setParameters, supports
public NormalizedL1Comparator(int dimensions)
public NormalizedL1Comparator(int dimensions, double comparisonValue)
public NormalizedL1Comparator(double[] deleteComparison, double[] insertComparison)
public NormalizedL1Comparator(double[] deleteComparison, double[] insertComparison, double[] skipDeleteComparison, double[] skipInsertComparison)
public double actualCompare(double[] a, double[] b)
SkipExtendedComparator
actualCompare
in class SkipExtendedComparator<double[],double[]>
a
- the left input.b
- the right input.public static double norm(@NonNull double[] v)
v
- a vector.Copyright (C) 2016 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/