Class OrdinalDistanceFunction
java.lang.Object
org.dkpro.statistics.agreement.distance.OrdinalDistanceFunction
- All Implemented Interfaces:
IDistanceFunction
public class OrdinalDistanceFunction extends java.lang.Object implements IDistanceFunction
Implementation of the
References:
IDistanceFunction interface for scoring the distance between
ordinal-scaled categories. That is to say, categories represent ranks, such as the values on a
Likert scale. A typical example is FULLY AGREE, RATHER AGREE, UNDECIDED, RATHER DISAGREE, FULLY
DISAGREE. Note that one cannot easily say that the difference between FULLY AGREE and RATHER
AGREE is equal. The intuition of the ordinal distance is function is rather to count the number
ranks in between a pair of given ranks. Consider the example by Krippendorff (1980): 10 units are
assigned the ranks 1, 2, 3, 3, 4, 4, 4, 4, 5, 10. Then intuitively, the difference should be much
smaller between 1 and 3 then between 3 and 5. In the case of uniform frequencies of the ranks
(e.g., 1, 1, 2, 2, 3, 3, 4, 4), the ordinal distance function equals the
IntervalDistanceFunction. Mathematically, the ordinal scale only allows for the equality
and comparison operations, but prohibits addition and multiplication. The distance function
assumes the ranks to be of type integer. For other category types, the distance function falls
back to a NominalDistanceFunction.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 OrdinalDistanceFunction() -
Method Summary
Modifier and Type Method Description doublemeasureDistance(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.
-
Constructor Details
-
OrdinalDistanceFunction
public OrdinalDistanceFunction()
-
-
Method Details
-
measureDistance
public double measureDistance(IAnnotationStudy study, java.lang.Object category1, java.lang.Object category2)Description copied from interface:IDistanceFunctionReturns 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:
measureDistancein interfaceIDistanceFunction
-