Open Stevod opened 2 years ago
That should work; I'll see if I can look into it.
Many thanks, as the ability to use different/custom metrics is why I selected the pynndescent package in the first place.
Also, I cannot pass the additional 'w' metric into a custom metric using metric_kwds={'w' : w.to_dict()} as I expected. Could you provide an example of how to do that as well for a custom function.
Much appreciated. David
Due to how things have to get handled by numba, in practice you need to pass all the required arguments in the correct order to the distance function. That means for weighted minkowski you'll have to pass w
and p
(if you just want to use p
you cna always use minkowski
instead). To pass w
you'll need to pass a vector of length giving the weight for each coordinate.
When I run this code, index = NNdescent(data = data, metric = 'weighted_minkowski', metric_kwds={'p':1} ) I get an error of no match with getitem. How can I pass this?
Also, I need to pass an array of weights to weight the metric. How can I pass those? By convetring to a dict?
Thanks, David