| Home | Trees | Indices | Help |
|
|---|
|
|
Distance Metrics. Compute the distance between two items (usually strings). As metrics, they must satisfy the following three requirements: 1. d(a, a) = 0 2. d(a, b) >= 0 3. d(a, c) <= d(a, b) + d(b, c)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Calculate the Levenshtein edit-distance between two strings. The edit distance is the number of characters that need to be substituted, inserted, or deleted, to transform s1 into s2. For example, transforming "rain" to "shine" requires three steps, consisting of two substitutions and one insertion: "rain" -> "sain" -> "shin" -> "shine". These operations could have been done in other orders, but at least three steps are needed.
|
Simple equality test. 0.0 if the labels are identical, 1.0 if they are different. >>> binary_distance(1,1) 0.0 >>> binary_distance(1,3) 1.0 |
Distance metric that takes into account partial agreement when multiple labels are assigned. >>> masi_distance(set([1,2]),set([1,2,3,4])) 0.5 Passonneau 2005, Measuring Agreement on Set-Valued Items (MASI) for Semantic and Pragmatic Annotation. |
Krippendorff'1 interval distance metric >>> interval_distance(1,10) 81 Krippendorff 1980, Content Analysis: An Introduction to its Methodology |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Apr 11 14:39:41 2011 | http://epydoc.sourceforge.net |