# Affine term structure model

Similarity learning is one type of a supervised machine learning task in artificial intelligence. It is closely related to regression and classification, but the goal is to learn from examples a function that measure how similar or related two objects are. It has applications in ranking and in recommendation systems.

## Learning setup

There are three common setups for similarity and metric distance learning.

A common approach for learning similarity, is to model the similarity function as a bilinear form. For example, in the case of ranking similarity learning, one aims to learn a matrix W that parametrizes the similarity function $f_{W}(x,z)=x^{T}Wz$ .

## Metric learning

Similarity learning is closely related to distance metric learning. Metric learning is the task of learning a distance function over objects. A metric or distance function has to obey three axioms: non-negativity, symmetry and subadditivity / triangle inequality.

When the objects $x_{i}$ are vectors in $R^{d}$ , then any positive definite matrix $W>0$ defines a distance function of the space of x through the bilinear form $f(x_{1},x_{2})=x_{1}^{T}Wx_{2}$ . Some well known approaches for metric learning include Large margin nearest neighbor  , Information theoretic metric learning (ITML).

In statistics, the covariance matrix of the data is sometimes used to define a distance metric called Mahalanobis distance.

## Applications

Similarity learning is used in information retrieval for learning to rank, and in recommendation systems. Also, many machine learning approaches rely on some metric. This include unsupervised learning such as clustering, which groups together close or similar objects. It also includes supervised approaches like K-nearest neighbor algorithm which rely on labels of nearby objects to decide on the label of a new object. Metric learning has been proposed as a preprocessing step for many of these approaches