Skip to content

Add weighted distance functions between two vectors #309

Open
@yu-iskw

Description

@yu-iskw

I'd like to use weighted distance function with Breeze. However, it is not easy for me to implemet them. If we want to implement like squaredDistance, we need the three parameters version of ZippedValues trait.

  • weighted euclidean distance
  • weighted cosine distance
  • weighted tanimoto distance
    and so on

I tried to implement a sample weighted distance function like below:
A weighted Euclidean distance function implementation
https://gist.github.com/yu-iskw/4e0d3a2f999effbcf640

But it seems that there are things we can't do.

  1. Take parameters as the combination of DenseVector and SparseVector
  2. Can not use Int, Float and Long type exclude Double in elements of DenseVector and SparseVector.

If anyone have any good idea about implementing them, could you teach me ?
And should we make them in the first place?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions