Skip to content
Advertisement

Sklearn NearestNeighbors (Mahalanobis) – too many arguments?

I’m using scikit-learn‘s NearestNeighbors with Mahalanobis distance.

JavaScript

d1 and d2 are both numpy arrays of 2-element lists of numbers. e.g.:

JavaScript

I’ve used almost this exact code in the past, but today I’m getting the following error:

JavaScript

Any tips on how to resolve this would be wildly appreciated! Thanks!

Advertisement

Answer

change 'V' to 'VI', maybe this help:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement