Similarity fail


#1

Hello, and first of all, thanks for reading and answering.

Here is the question, I attach image. Shouldn´t it be FALSE instead of TRUE?

Thanks!!!

similarity|625x500


#2


(Michael Pryor) #3

Threshold is not numerical difference, read the input description, it is percentage.


#4

Just out of curiosity, what is the percentage referring to? X% of the first number? Second number? Average?


(Michael Pryor) #5

I believe it is the percentage difference between them. If you want by tolerance I have in Pufferfish a Equality within Tolerance component.


#6

But 10% should be 110 or less not 111, 111 it is 11% isn´t?


(David Rutten) #7

Depends, 10% of 100 is 10, 10% of 111 is 11.1

I seem to remember the percentage applies to the bigger of the two numbers.


#8

Would maybe make sense to document this in the component description? Or wouldn’t it rather make sense to use the second number (“number to compare to”) as reference for the percentage then?


#9

i discovered the formula, if you multiply de threshold * second number and if it is lower than de absolute difference value it is TRUE but if it is higher it gives a FALSE


#10


(David Rutten) #11

I don’t think so, there’s a lot of symmetry in a comparison despite the fact that the values are ordered. I think it would be weird if two numbers either are or aren’t similar depending on the order alone.

In general percentage-compare is a bit too human-centric a metric to be genuinely useful. I think we’ll need to add more components for this sort of thing, and yes they’ll have to be properly documented.