Am 30.10.21 um 10:43 schrieb Riccardo (Jack) Lucchetti:
On Sat, 30 Oct 2021, Artur T. wrote:
> Am 30.10.21 um 10:37 schrieb Artur T.:
>> 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:
>
>> Also, the help text does not say anything on the return dimension in
>> case both matrices X and Y are given.
>
> Oh, actually this is not true. The help text says:
>
> "If Y is given, it must be a p×n matrix, each row of which is again
> treated as a point in n-space. In this case the return value is a
> column vector of length mp."
But in fact I think that when argument 3 is non-null, having a matrix as
output is preferable aafter all. If we all agree, I can take care of
this later today.
I think that's useful.
By the way, I've added a new unit-test script for distance() here:
https://sourceforge.net/p/gretl/workspace/ci/ffba5572df24a0d4f9a3236460a2...
This extra line
<>
actual = mshape(actual, cols(x))' # format as used by sklearn
</>
makes the current output comparable with what sklearn return.
_Most_ _importantly_: Gretl's pairwise computation of both the
"euclidean" and "manhattan" distances are in pair with what sklean
computes!
Artur