# Doing Mahalanobis Metric Learning on a Per-Population Basis?

I have a dataset that consists of pairs $(x,y)$, with:

• $x$ being a high dimensional vector of personal features (e.g height, weight etc) of individuals; the individuals belong to one of three different types of populations: young, middle-aged and old people.
• $y$ is their performance on some task (e.g, scoring a goal), $y\in \{{\pm 1\}}$

Since the populations are inherently different from one another, the same set of features can express differently. As an illustrative example, in the middle-aged group height could be an advantage (correlated with positive label) where in the old group, it could be a disadvantage (correlated with negative label).

My goal is to learn a task-specific similarity metric. That is, learn a mapping $d: X \times X \rightarrow [0,1]$ s.t $d(x_1,x_2)\approx 0$ if $x_1$ and $x_2$ are both good at scoring goals (regardless of which population they come from).

I am considering using the popular form of Mahalanobis distance learning using similarity and dissimilarity constraints, as suggested by my labeled data (example reference here). To address the fact I have different populations, I thought about learning the matrix $M$ that specifies the metric on a per-population basis.

My questions:

1. Using this approach, I have a measure of similarity for any two individuals belonging to the same population. BUT: How do I calculate the similarity between two individuals from different populations?
2. Are there any other suggested approaches that might make sense in this scenario?

Any relevant references, articles, reading material etc will be highly appreciated.