# Similarity measure

{{ safesubst:#invoke:Unsubst||$N=Merge from |date=__DATE__ |$B=
Template:MboxTemplate:DMCTemplate:Merge partner
}}
In computer science, a **similarity measure** or **similarity function** is a real-valued function that quantifies the similarity between two objects. Although no single definition of a similarity measure exists, usually similarity measures are in some sense the inverse of distance metrics: they take on large values for similar objects and either zero or a negative value for very dissimilar objects. E.g., in the context of cluster analysis, Frey and Dueck suggest defining a similarity measure

where is the squared Euclidean distance.^{[1]}

In information retrieval, cosine similarity is a commonly used similarity measure, defined on vectors arising from the bag of words model. In machine learning, common kernel functions such as the RBF kernel can be viewed as similarity functions.^{[2]}

## References

- {{#invoke:Citation/CS1|citation

|CitationClass=journal }}