Skip to content

Add more distance functions #6

@doxakis

Description

@doxakis

It would be great to have more distance functions ready to use.

The python lib implements lot of metrics.
http://hdbscan.readthedocs.io/en/latest/basic_hdbscan.html#distance-matrices

The following file expose distance functions:
https://github.com/scikit-learn-contrib/hdbscan/blob/master/hdbscan/dist_metrics.pyx

Some distance functions:

  • Chebyshev Distance
  • Minkowski Distance
  • W-Minkowski Distance
  • Mahalanobis Distance
  • Hamming Distance
  • Canberra Distance
  • Bray-Curtis Distance
  • Jaccard Distance
  • Matching Distance
  • Dice Distance
  • Kulsinski Distance
  • Rogers-Tanimoto Distance
  • Russell-Rao Distance
  • Sokal-Michener Distance
  • Sokal-Sneath Distance
  • Haversine Distance (2 dimensional)
  • Yule Distance

In the following folder: HdbscanSharp/Distance/
There is some examples. (For example, see ManhattanDistance)
It must implements IDistanceCalculator.

If there is some limitation, it can throw a meanful exception with explications.
For example, if the distance works only for 2 dimension, throw an exception.

I suggest to add one class for each new distance function and add minimal documentation (Description, formula and suggested use case if any. Check wikipedia).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions