Comments

You must log in or register to comment.

BenoitParis t1_j7v9wue wrote

Lots to choose from:

https://docs.scipy.org/doc/scipy/reference/spatial.distance.html

How do your vectors look like? What do you intend to do with them? Will you be clustering them? Indexing them? How many are there? How did you obtain them? What do they represent? What is their type?

5

TKMater OP t1_j7vayeo wrote

I have classified some data points as anomaly in timeseries data and calculated feature importance vectors for them. Now I want to calculate similarity between two anomalous data points based on their feature importance vector.

0

BrohammerOK t1_j7x21pg wrote

If you care as you said about both magnitude and direction, try with L2 (Euclidean distance) , not cosine similarity.

2

RitsusHusband t1_j7v7crt wrote

Could you take the squared difference?

0

Jucuco t1_j7vsc6p wrote

Inner product between metrics tells you the projection of one onto the other. Whatever the space you're building reperesents

0

lonelyrascal t1_j7vw6f4 wrote

Try cosine similarly?

0

lonelyrascal t1_j7vwf3f wrote

Well it also depends on whether you have sparse vectors or not... Some metrics work best for sparse vectors and other work for dense vectors. Check out scikit learn's pairwise distances metrics to understand better

2