Similarity percentage based on attributes and their quantities I have two sets that contain (partially overlapping) attributes in different quantities and I am looking for a method to compare the similarity between the sets based on the attributes and their quantities. I am new to this and I would appreciate any help!
Update: example
Set A contains pizza: 3, soda: 5, cake: 2
Set B contains: pizza: 4, cake: 1
How do I compare how similar those two sets are?

One simple to measure the degree of similarity between two sets is to take the difference between their relative frequencies.
Let all possible elements be $x_1,\ldots,x_k$, and suppose set A has $m$ elements of which, $m_{1}$ are of type $x_1$, $m_2$ elements of type $x_2$ and so on, $m_k$ of type $x_k$. Similarily for the set B, suppose it has $n$ elements of which, $n_1$ are of type $x_1$, $n_2$ of type $x_2$ and so on, $n_k$ of type $x_k$.
Then consider the index
$$
d_{AB} = \sum_{i=1}^k |m_i/m - n_i/n|.
$$
$d_{AB}$ reaches its minimum value, i.e. 0, when A and B have the same number of elements proportionally to their sizes; it assumes a value equal to 2 if the two sets are totally disjoint. Thus the higher the value of $d_{AB}$ the higher the degree of dissimilarity between the two sets in terms of the relative frequencies of their elements.
Example.
Let the data be as in the post, thus $x_1$ is pizza, $x_2$ is soda and $x_3$ is cake. In this case, we have $m_1=3$, $m_2=5$, $m_3=2$ and $n_1=4$, $n_2=0$, $n_3=1$ so
$$d_{AB} = \Big|\frac{3}{10}- \frac{4}{5}\Big| + \Big|\frac{5}{10}-\frac{0}{5}\Big| + \Big|\frac{2}{10}-\frac{1}{5}\Big| = 1.$$
The value of $d_{AB}$ is halfway between its minimum and maximum value so we may conclude that the two sets are partially similar.
Remark
Here I showed you one way to solve the problem, but it's easy to come up with many different ways of quantifying "similarity" in this context. It's hard to choose among them a priori without further details about why you seek to measure similarity, and what you will conclude from the result.
