ContextLab / quail

A python toolbox for analyzing and plotting free recall data
http://cdl-quail.readthedocs.io/en/latest/
MIT License
20 stars 10 forks source link

built in distance functions #91

Closed andrewheusser closed 5 years ago

andrewheusser commented 6 years ago

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 )