Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
6 votes
0 answers
129 views

K nearest neighbours algorithm

Here is a project that I worked on for a few days in June 2020. Since the algorithm is extremely slow, I looked into methods in order to parallelize operations but did not obtain any satisfactory ...
Aaron John Sabu's user avatar
2 votes
0 answers
122 views

Machine learning, kNN and Naïve Bayes algorithm

This is the task I am working on: In this assignment you will implement the K-Nearest Neighbour and Naïve Bayes algorithms and evaluate them on a real dataset using the stratified cross validation ...
Rafiul Nakib's user avatar
3 votes
0 answers
545 views

Locality Sensitive Hash (similar to k-Nearest Neighbor), in Python+Numpy

I've tried implementing Locality Sensitive Hash, the algorithm that helps recommendation engines, and powers apps like Shazzam that can identify songs you heard at restaurants. LSH is supposed to run ...
Josh.F's user avatar
  • 187
1 vote
2 answers
322 views

Top k closest pairs in a set of million 128-dimensional points [closed]

I have a set of 1 million points in 128-dimensional space. Among all trillion pairs of the points in the set, I need to get a subset of 100 million pairs whose cosine distances are less than that of ...
jayadeepk's user avatar
13 votes
2 answers
5k views

Removing neighbors in a point cloud

I have written a program to optimize a point cloud in dependency of their distances to each other. The code works very well for smaller number of points. For 1700 points it takes ca. 6 minutes. But I ...
Mohamad Reza Salehi Sadaghiani's user avatar
5 votes
1 answer
1k views

Pole (Hackerrank)

Problem Description Kevin was thinking about telephone poles and came up with an idea for a fun programming challenge. There are n telephone poles ascending a mountain and each pole has a weight and ...
foxtrotDS0x01's user avatar
4 votes
1 answer
3k views

KNN algorithm implemented in Python

This is the first time I tried to write some code in Python. I think it gives proper answers but probably some "vectorization" is needed ...
Newbie's user avatar
  • 710
2 votes
0 answers
1k views

Find k nearest points

I'm working on a problem to select k nearest points for a given point. Any advice for bugs, improvements are appreciated, including general advice to implement find nearest k points. My major idea is ...
Lin Ma's user avatar
  • 3,543
5 votes
1 answer
3k views

K-means clustering implemented in Python 3

Here is the classic K-means clustering algorithm implemented in Python 3. My main concern is time/memory efficiency and if there are version specific idioms that I could use to address issues of the ...
Sorrop's user avatar
  • 307
3 votes
2 answers
146 views

Getting the smallest snippet from content containing all keywords

This returns the smallest snippet from the content containing all of the given keywords (in any order). This provides the correct solution but I would like to know if it can be made more efficient. <...
nirvana's user avatar
  • 31
5 votes
2 answers
29k views

K-means clustering algorithm in python

Here is my implementation of the k-means algorithm in python. I would love to get any feedback on how it could be improved or any logical errors that you may see. I've left off a lot of the ...
alacy's user avatar
  • 193
11 votes
1 answer
14k views

K-Mean with Numpy

I have implemented the K-Mean clustering Algorithm in Numpy: ...
Frames Catherine White's user avatar