public class L1NormComparator extends ComparisonBasedSkipExtendedComparator<VectorialValue>
Constructor and Description |
---|
L1NormComparator(int dimensions) |
L1NormComparator(int dimensions,
double comparisonValue) |
L1NormComparator(Normalizer normalizer,
int dimensions) |
L1NormComparator(Normalizer normalizer,
int dimensions,
double comparisonValue) |
L1NormComparator(Normalizer normalizer,
VectorialValue deleteComparison,
VectorialValue insertComparison,
VectorialValue skipDeleteComparison,
VectorialValue skipInsertComparison) |
L1NormComparator(VectorialValue deleteComparison,
VectorialValue insertComparison,
VectorialValue skipDeleteComparison,
VectorialValue skipInsertComparison) |
Modifier and Type | Method and Description |
---|---|
double |
compare(VectorialValue a,
VectorialValue 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)
Please note that this has to be well-defined, even if an input is null.
|
double |
comparisonDerivative(int paramIdx,
VectorialValue a,
VectorialValue b)
This should implement the local derivative calculation in case of
comparisons.
|
double |
distance(double[] a,
double[] b)
Returns the L1-distance between the vectors a and b, given that they have
the same length.
|
boolean |
equals(Object obj) |
Normalizer |
getNormalizer()
Please refer to the corresponding setter method for more information.
|
int |
getNumberOfComparisonParameters()
Implementing classes should return the number of (derivative-relevant)
parameters used for the compare-function.
|
ValueType |
getType() |
int |
hashCode() |
void |
setNormalizer(Normalizer normalizer)
The L1-norm per default is bound by 0 but has no upper bound.
|
SparseLocalDerivative |
sparseComparisonDerivative(VectorialValue a,
VectorialValue b)
This should implement the local derivative calculation in case of
comparisons.
|
calculateLocalDerivative, calculateSparseLocalDerivative, delete, getDeleteComparison, getInsertComparison, getSkipDeleteComparison, getSkipFactor, getSkipInsertComparison, insert, isDynamic, setDeleteComparison, setDynamic, setInsertComparison, setSkipDeleteComparison, setSkipFactor, setSkipInsertComparison, skipDelete, skipInsert
getDeletionCost, getInsertionCost, getNumberOfParameters, getResultClass, getSkipDeletionCost, getSkipInsertionCost, setDeletionCost, setInsertionCost, setSkipDeletionCost, setSkipInsertionCost, transformToResult
public L1NormComparator(int dimensions)
public L1NormComparator(Normalizer normalizer, int dimensions)
public L1NormComparator(int dimensions, double comparisonValue)
public L1NormComparator(Normalizer normalizer, int dimensions, double comparisonValue)
public L1NormComparator(VectorialValue deleteComparison, VectorialValue insertComparison, VectorialValue skipDeleteComparison, VectorialValue skipInsertComparison)
public L1NormComparator(Normalizer normalizer, VectorialValue deleteComparison, VectorialValue insertComparison, VectorialValue skipDeleteComparison, VectorialValue skipInsertComparison)
public void setNormalizer(Normalizer normalizer)
normalizer
- a Normalizer.public Normalizer getNormalizer()
public double compare(VectorialValue a, VectorialValue b)
a
- the left input.b
- the right input.public double distance(double[] a, double[] b)
a
- a double vector.b
- a double vector.public ValueType getType()
public int hashCode()
hashCode
in class ComparisonBasedSkipExtendedComparator<VectorialValue>
public boolean equals(Object obj)
equals
in class ComparisonBasedSkipExtendedComparator<VectorialValue>
public double comparisonDerivative(int paramIdx, VectorialValue a, VectorialValue b)
comparisonDerivative
in class SkipExtendedComparator<VectorialValue>
paramIdx
- the index of the parameter the alignment is currently
derived to. Note that the first four parameters (0-3) are reserved for
the parameters of this superclass.a
- the value on the left side of the comparison.b
- the value on the right side of the comparison.public SparseLocalDerivative sparseComparisonDerivative(VectorialValue a, VectorialValue b)
sparseComparisonDerivative
in class SkipExtendedComparator<VectorialValue>
a
- the value on the left side of the comparison.b
- the value on the right side of the comparison.public int getNumberOfComparisonParameters()
getNumberOfComparisonParameters
in class SkipExtendedComparator<VectorialValue>
Copyright (C) 2013-2015 Benjamin Paaßen, Georg Zentgraf, 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/