Re: Calculating Minkowski distance between two rows

From: Begin Daniel <jfd553(at)hotmail(dot)com>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>, Babak Alipour <babak(dot)alipour(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Calculating Minkowski distance between two rows
Date: 2016-04-25 17:10:39
Message-ID: CY1PR10MB04745192E276F23A4490C03C94620@CY1PR10MB0474.namprd10.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am inclined to go with Francisco's solution
Daniel

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Francisco Olarte
Sent: April-25-16 10:46
To: Babak Alipour
Cc: Adrian Klaver; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Calculating Minkowski distance between two rows

Hi:

On Mon, Apr 25, 2016 at 4:26 PM, Babak Alipour <babak(dot)alipour(at)gmail(dot)com> wrote:
> That is correct. The function I've written only works when the two
> tables are named table_train and table_test; is it possible to
> generalize that to take in any two tables?

And only when all table_train columns are numbers AND table_test contains at least all of them AND they are numbers too.

Wouldn't it be easier to use numeric arrays to represent coordinate vectors?

Anyway, I'm not versed in all of this, wbut I would try to make a function to turn a table record to a numeric array and then write the numeric array version of the func and call them, divide and conquer.

Francisco Olarte.

--
Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2016-04-25 17:24:46 Re: Types of blocks in the `pg_stat_statements`
Previous Message Melvin Davidson 2016-04-25 16:30:07 Clarify "allow_system_table_mods"