Class IntervalDistanceFunction

java.lang.Object
org.dkpro.statistics.agreement.distance.IntervalDistanceFunction
All Implemented Interfaces:
IDistanceFunction
Direct Known Subclasses:
SquareDistanceFunction

public class IntervalDistanceFunction
extends java.lang.Object
implements IDistanceFunction
Implementation of the IDistanceFunction interface for scoring the distance between interval-scaled categories. That is to say, categories represent a numerical value whose difference can be measured. A typical example is date as measures, for instance, using the Gregorian calendar. We are able to measure the difference between the years 2010 and 2000 and to say that the difference equals the difference between he years 1980 and 1970. However, we cannot say that 2000 is twice the year 1000, since there is no absolute zero (note that the year 0 is arbitrarily defined and that we need to cater for years such as 200 BCE). For natural language processing tasks, judging the similarity between two entities on a linear scale of, say, 1 to 6 is another example for interval-scaled data. Mathematically, the interval scale only allows for the equality, comparison, and addition operations, but prohibits multiplication. The distance function returns the squared difference between the numerical representation of two categories. It thus assumes the categories to be integers or doubles and falls back to a NominalDistanceFunction for other data types.

References:
  • Krippendorff, K.: Content Analysis: An Introduction to Its Methodology. Beverly Hills, CA: Sage Publications, 1980.
Author:
Christian M. Meyer
See Also:
IDistanceFunction
  • Constructor Summary

    Constructors 
    Constructor Description
    IntervalDistanceFunction()  
  • Method Summary

    Modifier and Type Method Description
    double measureDistance​(IAnnotationStudy study, java.lang.Object category1, java.lang.Object category2)
    Returns a distance value for the given pair of categories used within the given annotation study.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • measureDistance

      public double measureDistance​(IAnnotationStudy study, java.lang.Object category1, java.lang.Object category2)
      Description copied from interface: IDistanceFunction
      Returns a distance value for the given pair of categories used within the given annotation study. Normally, the measure should return a distance of 0 if, and only if, the two categories are equal and a positive number otherwise.
      Specified by:
      measureDistance in interface IDistanceFunction