fbpx
Wikipedia

Jaro–Winkler distance

In computer science and statistics, the Jaro–Winkler distance is a string metric measuring an edit distance between two sequences. It is a variant proposed in 1990 by William E. Winkler of the Jaro distance metric (1989, Matthew A. Jaro).

The Jaro–Winkler distance uses a prefix scale which gives more favourable ratings to strings that match from the beginning for a set prefix length .

The higher the Jaro–Winkler distance for two strings is, the less similar the strings are. The score is normalized such that 0 means an exact match and 1 means there is no similarity. The original paper actually defined the metric in terms of similarity, so the distance is defined as the inversion of that value (distance = 1 − similarity).

Although often referred to as a distance metric, the Jaro–Winkler distance is not a metric in the mathematical sense of that term because it does not obey the triangle inequality.

Definition

Jaro similarity

The Jaro similarity   of two given strings   and   is

 

Where:

  •   is the length of the string  ;
  •   is the number of matching characters (see below);
  •   is the number of transpositions (see below).

Jaro similarity score is 0 if the strings do not match at all, and 1 if they are an exact match. In the first step, each character of   is compared with all its matching characters in  . Two characters from   and   respectively, are considered matching only if they are the same and not farther than   characters apart. For example, the following two nine character long strings, FAREMVIEL and FARMVILLE, have 8 matching characters. 'F', 'A' and 'R' are in the same position in both string. Also 'M', 'V', 'I', 'E' and 'L' are within three (result of  ) characters away.[1] If no matching characters are found then the strings are not similar and the algorithm terminates by returning Jaro similarity score 0.

If non-zero matching characters are found, the next step is to find the number of transpositions. Transposition is the number of matching characters that are not in the right order divided by two. In the above example between FAREMVIEL and FARMVILLE, 'E' and 'L' are the matching characters that are not in the right order. So the number of transposition is one.

Finally, plugging in the number of matching characters   and number of transpositions   the Jaro similarity of FAREMVIEL and FARMVILLE can be calculated,  

Jaro–Winkler similarity

Jaro–Winkler similarity uses a prefix scale   which gives more favorable ratings to strings that match from the beginning for a set prefix length  . Given two strings   and  , their Jaro–Winkler similarity   is:

 

where:

  •   is the Jaro similarity for strings   and  
  •   is the length of common prefix at the start of the string up to a maximum of 4 characters
  •   is a constant scaling factor for how much the score is adjusted upwards for having common prefixes.   should not exceed 0.25 (i.e. 1/4, with 4 being the maximum length of the prefix being considered), otherwise the similarity could become larger than 1. The standard value for this constant in Winkler's work is  

The Jaro–Winkler distance   is defined as  .

Although often referred to as a distance metric, the Jaro–Winkler distance is not a metric in the mathematical sense of that term because it does not obey the triangle inequality.[2] The Jaro–Winkler distance also does not satisfy the identity axiom  .

Relationship with other edit distance metrics

There are other popular measures of edit distance, which are calculated using a different set of allowable edit operations. For instance,

Edit distance is usually defined as a parameterizable metric calculated with a specific set of allowed edit operations, and each operation is assigned a cost (possibly infinite). This is further generalized by DNA sequence alignment algorithms such as the Smith–Waterman algorithm, which make an operation's cost depend on where it is applied.

See also

Footnotes

  1. ^ "What is Jaro-Winkler Similarity?". www.baseclass.io. Retrieved 26 July 2012.
  2. ^ "Jaro-Winkler «  Inviting Epiphany". RichardMinerich.com. Retrieved 12 June 2017.

References

  • Cohen, W. W.; Ravikumar, P.; Fienberg, S. E. (2003). "A comparison of string distance metrics for name-matching tasks" (PDF). KDD Workshop on Data Cleaning and Object Consolidation. 3: 73–8.
  • Jaro, M. A. (1989). "Advances in record linkage methodology as applied to the 1985 census of Tampa Florida". Journal of the American Statistical Association. 84 (406): 414–20. doi:10.1080/01621459.1989.10478785.
  • Jaro, M. A. (1995). "Probabilistic linkage of large public health data file". Statistics in Medicine. 14 (5–7): 491–8. doi:10.1002/sim.4780140510. PMID 7792443.
  • Winkler, W. E. (1990). "String Comparator Metrics and Enhanced Decision Rules in the Fellegi-Sunter Model of Record Linkage" (PDF). Proceedings of the Section on Survey Research Methods. American Statistical Association: 354–359.
  • Winkler, W. E. (2006). "Overview of Record Linkage and Current Research Directions" (PDF). Research Report Series, RRS.

External links

jaro, winkler, distance, this, article, about, measure, other, uses, jaro, computer, science, statistics, string, metric, measuring, edit, distance, between, sequences, variant, proposed, 1990, william, winkler, jaro, distance, metric, 1989, matthew, jaro, use. This article is about the measure For other uses see Jaro In computer science and statistics the Jaro Winkler distance is a string metric measuring an edit distance between two sequences It is a variant proposed in 1990 by William E Winkler of the Jaro distance metric 1989 Matthew A Jaro The Jaro Winkler distance uses a prefix scale p displaystyle p which gives more favourable ratings to strings that match from the beginning for a set prefix length ℓ displaystyle ell The higher the Jaro Winkler distance for two strings is the less similar the strings are The score is normalized such that 0 means an exact match and 1 means there is no similarity The original paper actually defined the metric in terms of similarity so the distance is defined as the inversion of that value distance 1 similarity Although often referred to as a distance metric the Jaro Winkler distance is not a metric in the mathematical sense of that term because it does not obey the triangle inequality Contents 1 Definition 1 1 Jaro similarity 1 2 Jaro Winkler similarity 2 Relationship with other edit distance metrics 3 See also 4 Footnotes 5 References 6 External linksDefinition EditJaro similarity Edit The Jaro similarity s i m j displaystyle sim j of two given strings s 1 displaystyle s 1 and s 2 displaystyle s 2 is s i m j 0 if m 0 1 3 m s 1 m s 2 m t m otherwise displaystyle sim j left begin array l l 0 amp text if m 0 frac 1 3 left frac m s 1 frac m s 2 frac m t m right amp text otherwise end array right Where s i displaystyle s i is the length of the string s i displaystyle s i m displaystyle m is the number of matching characters see below t displaystyle t is the number of transpositions see below Jaro similarity score is 0 if the strings do not match at all and 1 if they are an exact match In the first step each character of s 1 displaystyle s 1 is compared with all its matching characters in s 2 displaystyle s 2 Two characters from s 1 displaystyle s 1 and s 2 displaystyle s 2 respectively are considered matching only if they are the same and not farther than max s 1 s 2 2 1 displaystyle left lfloor frac max s 1 s 2 2 right rfloor 1 characters apart For example the following two nine character long strings FAREMVIEL and FARMVILLE have 8 matching characters F A and R are in the same position in both string Also M V I E and L are within three result of max 9 9 2 1 displaystyle lfloor tfrac max 9 9 2 rfloor 1 characters away 1 If no matching characters are found then the strings are not similar and the algorithm terminates by returning Jaro similarity score 0 If non zero matching characters are found the next step is to find the number of transpositions Transposition is the number of matching characters that are not in the right order divided by two In the above example between FAREMVIEL and FARMVILLE E and L are the matching characters that are not in the right order So the number of transposition is one Finally plugging in the number of matching characters m displaystyle m and number of transpositions t displaystyle t the Jaro similarity of FAREMVIEL and FARMVILLE can be calculated 1 3 8 9 8 9 8 1 8 0 88 displaystyle frac 1 3 left frac 8 9 frac 8 9 frac 8 1 8 right 0 88 Jaro Winkler similarity Edit Jaro Winkler similarity uses a prefix scale p displaystyle p which gives more favorable ratings to strings that match from the beginning for a set prefix length ℓ displaystyle ell Given two strings s 1 displaystyle s 1 and s 2 displaystyle s 2 their Jaro Winkler similarity s i m w displaystyle sim w is s i m w s i m j ℓ p 1 s i m j displaystyle sim w sim j ell p 1 sim j where s i m j displaystyle sim j is the Jaro similarity for strings s 1 displaystyle s 1 and s 2 displaystyle s 2 ℓ displaystyle ell is the length of common prefix at the start of the string up to a maximum of 4 characters p displaystyle p is a constant scaling factor for how much the score is adjusted upwards for having common prefixes p displaystyle p should not exceed 0 25 i e 1 4 with 4 being the maximum length of the prefix being considered otherwise the similarity could become larger than 1 The standard value for this constant in Winkler s work is p 0 1 displaystyle p 0 1 The Jaro Winkler distance d w displaystyle d w is defined as d w 1 s i m w displaystyle d w 1 sim w Although often referred to as a distance metric the Jaro Winkler distance is not a metric in the mathematical sense of that term because it does not obey the triangle inequality 2 The Jaro Winkler distance also does not satisfy the identity axiom d x y 0 x y displaystyle d x y 0 leftrightarrow x y Relationship with other edit distance metrics EditMain article Edit distanceThere are other popular measures of edit distance which are calculated using a different set of allowable edit operations For instance the Levenshtein distance allows deletion insertion and substitution the Damerau Levenshtein distance allows insertion deletion substitution and the transposition of two adjacent characters the longest common subsequence LCS distance allows only insertion and deletion not substitution the Hamming distance allows only substitution hence it only applies to strings of the same length Edit distance is usually defined as a parameterizable metric calculated with a specific set of allowed edit operations and each operation is assigned a cost possibly infinite This is further generalized by DNA sequence alignment algorithms such as the Smith Waterman algorithm which make an operation s cost depend on where it is applied See also EditRecord linkage CensusFootnotes Edit What is Jaro Winkler Similarity www baseclass io Retrieved 26 July 2012 Jaro Winkler Inviting Epiphany RichardMinerich com Retrieved 12 June 2017 References EditCohen W W Ravikumar P Fienberg S E 2003 A comparison of string distance metrics for name matching tasks PDF KDD Workshop on Data Cleaning and Object Consolidation 3 73 8 Jaro M A 1989 Advances in record linkage methodology as applied to the 1985 census of Tampa Florida Journal of the American Statistical Association 84 406 414 20 doi 10 1080 01621459 1989 10478785 Jaro M A 1995 Probabilistic linkage of large public health data file Statistics in Medicine 14 5 7 491 8 doi 10 1002 sim 4780140510 PMID 7792443 Winkler W E 1990 String Comparator Metrics and Enhanced Decision Rules in the Fellegi Sunter Model of Record Linkage PDF Proceedings of the Section on Survey Research Methods American Statistical Association 354 359 Winkler W E 2006 Overview of Record Linkage and Current Research Directions PDF Research Report Series RRS External links Editstrcmp c Original C implementation by the author of the algorithm nltk metrics distance module Python implementation in the Natural Language Toolkit Retrieved from https en wikipedia org w index php title Jaro Winkler distance amp oldid 1124567491, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.