jcolibri.method.retrieve.NNretrieval.similarity
Class StandardGlobalSimilarityFunction
java.lang.Object
jcolibri.method.retrieve.NNretrieval.similarity.StandardGlobalSimilarityFunction
- All Implemented Interfaces:
- GlobalSimilarityFunction
- Direct Known Subclasses:
- Average
public abstract class StandardGlobalSimilarityFunction
- extends java.lang.Object
- implements GlobalSimilarityFunction
Utility class to compute global similarities.
The implemented compute(...) method computes the similarity of the sub-attributes
of this compound attribute and then calls the computeSimilarity() abstract method to
obtain the similarity value.
That way, the computeSimilarity() method is a hook to easly compute global similarities.
- Version:
- 1.0
- Author:
- Juan A. Recio-Garcia
Method Summary |
double |
compute(CaseComponent componentOfCase,
CaseComponent componentOfQuery,
CBRCase _case,
CBRQuery _query,
NNConfig numSimConfig)
Computes the similarities of the sub-attributes of this CaseComponent and calls the computeSimilarity() method with those values. |
abstract double |
computeSimilarity(double[] values,
double[] weigths,
int numberOfvalues)
Hook method that must be implemented by subclasses returned the global similarity value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StandardGlobalSimilarityFunction
public StandardGlobalSimilarityFunction()
compute
public double compute(CaseComponent componentOfCase,
CaseComponent componentOfQuery,
CBRCase _case,
CBRQuery _query,
NNConfig numSimConfig)
- Computes the similarities of the sub-attributes of this CaseComponent and calls the computeSimilarity() method with those values.
- Specified by:
compute
in interface GlobalSimilarityFunction
- Parameters:
componentOfCase
- compound attribute of the casecomponentOfQuery
- compound attribute of the query_case
- case being compared_query
- query being comparednumSimConfig
- Similarity functions configuration
- Returns:
- a value between [0..1]
- See Also:
GlobalSimilarityFunction.compute(jcolibri.cbrcore.CaseComponent, jcolibri.cbrcore.CaseComponent, jcolibri.cbrcore.CBRCase, jcolibri.cbrcore.CBRQuery, jcolibri.method.retrieve.NNretrieval.NNConfig)
computeSimilarity
public abstract double computeSimilarity(double[] values,
double[] weigths,
int numberOfvalues)
- Hook method that must be implemented by subclasses returned the global similarity value.
- Parameters:
values
- of the similarity of the sub-attributesweigths
- of the sub-attributesnumberOfvalues
- (or sub-attributes) that were obtained (some subattributes may not compute for the similarity).
- Returns:
- a value between [0..1]