ContextLab/quail

built in distance functions

andrewheusser opened this issue · 0 comments

define a set of built-in distance function (perhaps under quail.dist) such as:
quail.dist.match = lambda a, b: int(a!=b)
quail.distance.cdist = lambda a, b, s: scipy.spatial.distance.cdist(a, b, metric=s) (hide this one and/or separate it out in the documentation?)
quail.dist.correlation = lambda a, b: quail.distance.cdist(a, b, 'correlation')
quail.dist.euclidean = lambda a, b: quail.distance.cdist(a, b, 'euclidean')
(can add similar support for all functions supported by cdist)
etc. (although i think these two cover all of the distance functions we're using and/or have been discussing-- e.g. absolute difference is a special case of euclidean distance where n dimensions = 1)

(ref #90 comments from @jeremymanning )