Class RatioDistanceFunction

java.lang.Object
org.dkpro.statistics.agreement.distance.RatioDistanceFunction
All Implemented Interfaces:
IDistanceFunction

public class RatioDistanceFunction
extends java.lang.Object
implements IDistanceFunction
Implementation of the IDistanceFunction interface for scoring the distance between ratio-scaled categories. That is to say, categories represent a numerical value whose difference and distance to a zero element can be measured. A typical example is measuring the time needed for a certain task: it makes a large difference if one accomplishes the task in 1 minute or in 5 minutes, but there is not much difference between requiring 3 full hours and 3 hours plus 5 minutes. Mathematically, the ratio scale allows for the equality, comparison, addition, and multiplication operations, which is why probabilities and measuring entropy is an often-used example for ratio scaled values (cf. Resnik & Lin, 2010). The distance function 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.
  • Resnik, P. & Lin, J.: Evaluation of NLP Systems. In: The Handbook of Computational Licensesnguistics and Natural Language Processing, p. 271–295, Chichester/Malden: Wiley-Blackwell, 2010.
Author:
Christian M. Meyer
See Also:
IDistanceFunction
  • Constructor Summary

    Constructors 
    Constructor Description
    RatioDistanceFunction()  
  • 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