[mlpack] Custom metric question

Ryan Curtin ryan at ratml.org
Mon Feb 8 09:53:56 EST 2016


On Sun, Feb 07, 2016 at 02:49:21PM +0100, Alasdair Newson wrote:
> Dear all,
> 
> I recently downloaded mlpack, and I am trying to use it for a knnsearch,
> with a customised metric. I am having some trouble coding this, so I
> wondered if anyone has tried this before, and might have some example code.
> 
> At the moment, I am trying to define a NeighborSearch class which uses a
> custom metric. I had tried with the default options, but apparently a
> custom metric is not compatible with the HRect bound type. I am trying with
> a BallBound, but I am still having compilation problems. Has anyone done
> this before ?
> 
> Kind regards,
> 
> Alasdair Newson

Hi Alasdair,

You're right that a custom metric isn't compatible with the HRectBound
type.  This is because the HRectBound is written specifically for an
LMetric.

The BallBound is more flexible, though, and should be able to handle
other types of metrics.  Can you paste the compilation problems that you
are having?  That would shed some light on the issue.

Thanks,

Ryan

-- 
Ryan Curtin    | "Are those... live rounds?"
ryan at ratml.org | "Seven-six-two millimeter.  Full metal jacket."



More information about the mlpack mailing list