Hi,
I am currently testing the new distance() function under development.
Thank you again for this new feature.
I am focusing on the pairwise case where both matrices X and Y are
given. Here is a toy example:
<hansl>
clear
set verbose off
matrix X = {1, 2; 3, 4}
matrix Y = {1, 2; 0, 3}
expected_distances = {0, 2; 4, 4}
matrix actual = distance(X, "manhattan", Y)
print actual
print expected_distances
actual (4 x 1)
0
2
4
4
expected_distances (2 x 2)
0 2
4 4
</hansl>
The matrix expected_distances is replicating sklearn's behavior. As you
can see, sklearn returns a matrix instead of a column vector. I am not
sure what the standard is and/ or other software packages return. I just
want to mention this. Being in line with some widely-applied "standard"
is useful, I would say. I also think that the matrix version is easier
to read - but that might be a matter of taste ;-)
Also, the help text does not say anything on the return dimension in
case both matrices X and Y are given.
Artur