Quantcast
Channel: Is there a way to make this Python kNN function more efficient? - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by user2379410 for Is there a way to make this Python kNN function...

You're just running into the slowness of Python (or rather the CPython interpreter I should say I guess). From wikipedia:NumPy targets the CPython reference implementation of Python, which is a...

View Article


Answer by Ara for Is there a way to make this Python kNN function more...

Here are the points I can think of:you are computing the distance between one sample and every other every time you call closestK so you compute the distance between every sample twice (once...

View Article


Is there a way to make this Python kNN function more efficient?

After having troubles with MATLAB I decided to try Python:I wrote a function that calculates kNN when the samples are of my own class using my own distance function:def closestK(sample, otherSamples,...

View Article
Browsing all 3 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>