Normalized compression distance

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Normalized compression distance is way of measuring the similarity between two objects, be it two documents, two letters, two emails, two music scores, two languages, two programs, two pictures, two systems, two genomes, to name a few. Such a measurement should not be application dependent or arbitrary. A reasonable definition for the similarity between two objects is how difficult it is to transform them into each other.

Information distance

We assume that the objects one talks about are finite strings of 0s and 1s. Thus we mean string similarity. Every computer file is of this form, that is, if an object is a file in a computer it is of this form. One can define the information distance between strings x and y as the length of the shortest program p that computes x from y and vice versa. This shortest program is in a fixed programming language. For technical reasons one uses the theoretical notion of Turing machines. Moreover, to express the length of p one uses the notion of Kolmogorov complexity. Then, it has been shown [1]

|p| = \max \{K(x\mid y),K(y\mid x)\}

up to logarithmic additive terms which can be ignored. This information distance is shown to be a metric (it satisfies the metric inequalities up to a logarithmic additive term), is universal (it minorizes every computable distance as computed for example from features up to a constant additive term).[1]

Normalized information distance (similarity metric)

The information distance is absolute, but if we want to express similarity, then we are more interested in relative ones. For example, if two strings of length 1,000,000 differ by 1000 bits, then we are inclined to think that those strings are relatively more similar than two strings of 1000 bits that have that distance. Hence we need to normalize to obtain a similarity metric. This way one obtains the normalized information distance (NID),

 NID(x,y) = \frac{ \max\{K{(x\mid y)},K{(y\mid x)}\} }{ \max \{K(x),K(y)\}},

where K(x\mid y) is algorithmic information of x given y as input. The NID is called `the similarity metric.' since the function NID(x,y) has been shown to satisfy the basic requirements for a metric distance measure.[2][3] However, it is not computable or even semicomputable.[4]

Normalized compression distance

While the NID metric is not computable, it has an abundance of applications. Simply approximating K by real-world compressors, with Z(x) is the binary length of the file x compressed with compressor Z (for example "gzip", "bzip2", "PPMZ") in order to make NID easy to apply.[2] Vitanyi and Cilibrasi rewrote the NID to obtain the Normalized Compression Distance (NCD)

 NCD_Z(x,y) = \frac{Z(xy) - \min \{Z(x),Z(y)\}}{\max \{Z(x),Z(y)\}}. [3]

The NCD is actually a family of distances parametrized with the compressor Z. The better Z is, the closer the NCD approaches the NID, and the better the results are.[3]

Applications

The normalized compression distance has been used to fully automatically reconstruct language and phylogenetic trees.[2][3] It can also be used for new applications of general clustering and classification of natural data in arbitrary domains,[3] for clustering of heterogeneous data,[3] and for anomaly detection across domains.[5] The NID and NCD have been applied to numerous subjects, including music classification,[3] to analyze network traffic and cluster computer worms and viruses,[6] authorship attribution,[7] gene expression dynamics,[8] predicting useful versus useless stem cells,[9] critical networks,[10] image registration,[11] question-answer systems.[12]

Performance

Researchers from the datamining community use NCD and variants as "parameter-free, feature-free" data-mining tools.[5] One group have experimentally tested a closely related metric on a large variety of sequence benchmarks. Comparing their compression method with 51 major methods found in 7 major data-mining conferences over the past decade, they established superiority of the compression method for clustering heterogeneous data, and for anomaly detection, and competitiveness in clustering domain data.

NCD has an advantage of being robust to noise.[13] However, although NCD appears "parameter-free", practical questions include which compressor to use in computing the NCD and other possible problems.[14]

Normalized Google distance

Objects can be given literally, like the literal four-letter genome of a mouse, or the literal text of War and Peace by Tolstoy. For simplicity we take it that all meaning of the object is represented by the literal object itself. Objects can also be given by name, like "the four-letter genome of a mouse," or "the text of `War and Peace' by Tolstoy." There are also objects that cannot be given literally, but only by name, and that acquire their meaning from their contexts in background common knowledge in humankind, like "home" or "red." We are interested in semantic similarity. Using code-word lengths obtained from the page-hit counts returned by Google from the web, we obtain a semantic distance using the NCD formula and viewing Google as a compressor useful for data mining, text comprehension, classification, and translation. The associated NCD, called the normalized Google distance (NGD) can be rewritten as

 NGD(x,y)= \frac{ \max \{\log f(x), \log f(y)\} - \log f(x,y) }{ \log N - \min\{\log f(x), \log f(y) \}},

where f(x) denotes the number of pages containing the search term x, and f(x,y) denotes the number of pages containing both x and y,) as returned by Google or any search engine capable of returning an aggregate page count. The number N can be set to the number of pages indexed although it is more proper to count each page according to the number of search terms or phrases it contains. As rule of the thumb one can multiply the number of pages by, say, a thousand...[15]

Software implementation

For a publicly available open-source downloadable software tool CompLearn, for both NCD and NGD, see http://www.complearn.org.

References

  1. 1.0 1.1 C.H. Bennett, P. Gacs, M. Li, P.M.B. Vitányi, and W. Zurek, Information Distance, IEEE Trans. Inform. Theory, IT-44:4(1998) 1407–1423
  2. 2.0 2.1 2.2 Lua error in package.lua at line 80: module 'strict' not found.
  3. 3.0 3.1 3.2 3.3 3.4 3.5 3.6 Lua error in package.lua at line 80: module 'strict' not found.
  4. S.A. Terwijn, L. Torenvliet, and P.M.B. Vitanyi, Nonapproximability of the Normalized Information Distance, J. Comput. System Sciences, 77:4(2011), 738–742
  5. 5.0 5.1 Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. Lua error in package.lua at line 80: module 'strict' not found.
  15. Lua error in package.lua at line 80: module 'strict' not found.

External links

  • M. Li and P. Vitanyi, An Introduction to Kolmogorov Complexity and Its Applications,Springer-Verlag, New York, 3rd Edition 2008,