You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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 wandp (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
The text was updated successfully, but these errors were encountered: