Similarity measure based on multiple classes from a hierarchical taxonomy? Could anyone recommend a good similarity measure for objects which have multiple classes, where each class is part of a hierarchy?

For example, let's say the classes look like:

1 Produce
  1.1 Eggs
    1.1.1 Duck eggs
    1.1.2 Chicken eggs
  1.2 Milk
    1.2.1 Cow milk
    1.2.2 Goat milk
2 Baked goods
  2.1 Cakes
    2.1.1 Cheesecake
    2.1.2 Chocolate


An object might be tagged with items from the above at any level, e.g.:

Omelette: eggs, milk (1.1, 1.2)
Duck egg omelette: duck eggs, milk (1.1.1, 1.2)
Goat milk chocolate cheesecake: goat milk, cheesecake, chocolate (1.2.2, 2.1.1, 2.1.2)
Beef: produce (1)


If the classes weren't part of a hierarchy, I'd probably I'd look at cosine similarity (or equivalent) between classes assigned to an object, but I'd like to use the fact that different classes with the same parents also have some similarity value (e.g. in the example above, beef has some small similarity to omelette, since they both have items from the class '1 produce').

If it helps, the hierarchy has ~200k classes, with a maximum depth of 5.
While I don't have enough expertise to advise you on selection of the best similarity measure, I've seen a number of them in various papers. The following collection of research papers hopefully will be useful to you in determining the optimal measure for your research. Please note that I intentionally included papers, using both frequentist and Bayesian approaches to hierarchical classification, including class information, for the sake of more comprehensive coverage.

Frequentist approach:


Semantic similarity based on corpus statistics and lexical taxonomy
Can’t see the forest for the leaves: Similarity and distance measures for hierarchical taxonomies with a patent classification example (also see additional results and data)
Learning hierarchical similarity metrics
A new similarity measure for taxonomy based on edge counting
Hierarchical classification of real life documents
Hierarchical document classification using automatically generated hierarchy
Split-Order distance for clustering and classification hierarchies
A hierarchical k-NN classifier for textual data


Bayesian approach:


Improving classification when a class hierarchy is available using a hierarchy-based prior
Bayesian aggregation for hierarchical genre classification
Hierarchical classification for multiple, distributed web databases