jcolibri.method.retrieve.NNretrieval.similarity.local.recommenders
Class McSherryLessIsBetter

java.lang.Object
  extended by jcolibri.method.retrieve.NNretrieval.similarity.local.recommenders.McSherryLessIsBetter
All Implemented Interfaces:
LocalSimilarityFunction

public class McSherryLessIsBetter
extends java.lang.Object
implements LocalSimilarityFunction

This function returns the similarity of two numbers following the McSherry - Less is Better formulae sim(c.a,q.a)= (max(a) - c.a) / (max(a)-min(a)) min(a) and max(a) must be defined by the designer. q.a is not taken into account.


Constructor Summary
McSherryLessIsBetter(double maxAttributeValue, double minAttributeValue)
          Constructor. max and min values are ignored for enum types.
 
Method Summary
 double compute(java.lang.Object caseObject, java.lang.Object queryObject)
          Applies the similarity function.
 boolean isApplicable(java.lang.Object o1, java.lang.Object o2)
          Applicable to any Number subinstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

McSherryLessIsBetter

public McSherryLessIsBetter(double maxAttributeValue,
                            double minAttributeValue)
Constructor. max and min values are ignored for enum types.

Method Detail

compute

public double compute(java.lang.Object caseObject,
                      java.lang.Object queryObject)
               throws NoApplicableSimilarityFunctionException
Applies the similarity function.

Specified by:
compute in interface LocalSimilarityFunction
Parameters:
caseObject - is a Number
queryObject - is a Number
Returns:
result of apply the similarity function.
Throws:
NoApplicableSimilarityFunctionException

isApplicable

public boolean isApplicable(java.lang.Object o1,
                            java.lang.Object o2)
Applicable to any Number subinstance

Specified by:
isApplicable in interface LocalSimilarityFunction

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es