# Multidimensional similarity space

Does anyone know about multidimensional similarity space? I am working on mixed data set (numerical and categorical), I want to create multidimensional similarity space, contains pairs of similarity measures (Numerical similarity, Categorical similarity), I have divided my data set into parts, numerical subset, categorical subset, I applied euclidean distance on numerical part.

Then I calculate the similarity based on :S(X,Y)= 1 - D(X,Y). For categorical part I used simple matching, two similarity matrices are created now, I would like to present them as pairs in space. I am going to extend my work to include another type of data set.

Since this is a general issue and you didn't give many details regarding your data, I'll present a very simplistic toy example which you'll hopefully be able to extend to your data.

Suppose I represent people using two attributes: Their age and their hair color. I am lazy so my data-set only includes three examples:

Sarah = (30, "Black")
Hannah = (26, "Blonde")
Michaela = (35, "Black")


My goal is to create a pair-wise distance matrix that will represent all the similarities in the data. It will be a $3\times 3$ symmetric matrix, with the $ij$-th entry being a measure of how dissimilar are examples $i$ and $j$. So all entries on the diagonal will be 0.

The attributes are different: age is continuous and hair-color is categorical. I need to choose a different "similarity" measure for each one. In my case:

• Age: Squared distance.
• Hair color: 0-1 loss. See here for a detailed survey of more "advanced" similarity measures for categorical data, choose one which will be appropriate in your case.

Finally, I need some way of "combining" between the two attributes. Essentially, I need to chose a weight vector, $(w_1, w_2)$, s.t $w_1 + w_2 =1$. You can think of $w_1$ as a measure of importance of the age attribute in determining similarity between two individuals. In my case, I think it's more important than hair-color, so I'll choose $w_1$ to be equal to $0.8$ and $w_2 = 0.2$.

Now I can bring everything together to form the combined distance matrix. Let's do one calculation for example:

d(Sarah, Hannah) = 0.8 * d_1(30,26) + 0.2*d_2("Black", "Blonde") = 0.8*16 + 0.2 *1


Note that it's actually equivalent to calculating two separate distance matrices (one for the age attribute, and the other for the hair-color), and then calculating the weighed sum of them according to the weights $w$.

As a final note, a good practice - which I didn't do in my calculation above - is to normalize the two matrices before summing them, in order to bring their units into similar scales (in my case, 0.8*16 "dominates" the 0.2*1 factor).