[pymvpa] SOM with custom distance metric

Michael Hanke mih at debian.org
Tue Aug 14 07:18:11 UTC 2012

On Mon, Aug 13, 2012 at 05:05:12PM -0400, Alan Johnson wrote:
> Will do, but I'm just wondering someone with more experience using
> SOMs could tell me if the issue is as simple as it seems, or if there
> is more subtlety to using a different metric than modifying _get_bmu()

Modifying get_bmu() will allow you to change the distance metric that is
used to determine the "epi-center" in the SOM for a particular training
sample. So: yes, it is as simple as that.

OTOH, there is a second distance metric hidden in the choice of kernel
used to adjust the node weights for each iteration.

Both distance metrics could be exposed as parameters (e.g. functions
that can be assigned to the SOM class). Ideally, the could be adjusted
to support all of SciPy's distance functions, or rather obey their
conventions. And maybe there is a way to re-use the code in
mvpa2/kernels/... to supply a custom kernel to SOM as well.

Thanks in advance,


Michael Hanke

More information about the Pkg-ExpPsy-PyMVPA mailing list