nearest-neighbor

Using ruby to find similar recipes based on ingredients they contain

I have a collection of recipes, each having a number of ingredients. This information is stored in a join table. Give a recipe, I'd like to find recipes similar to it based on ingredients. How would I go about doing this? ...

Alternative to distance metric in nearest neighbor algorithm?

Hi, I came across an implementation of the nearest neighbor algorithm for finding matches between certain keypoints in two similar images. The keypoints were generated by the SIFT algorithm. The points are described by a 128 dimension vector, and there are many such points in both images. The matching algorithm uses the nearest neighbor...

How to find similar users using their interests

I am trying to create a system which would be able to find users with similar favourite movies/books/interests/etc., much like neighbours on last.fm. Users sharing the most mutual interests would have the highest match and would be displayed in user profiles (5 best matches or so). Is there any reasonably fast way to do this? The obviou...

Locality Sensitive Hashing - finding probabilities and values for R

Thanks to those who've answered my previous questions and gotten me this far. I have a table of about 25,000 vectors, each with 48 dimensions, with values ranging from 0-255. I am attempting to develop a Locality Sensitive Hash (http://en.wikipedia.org/wiki/Locality-sensitive_hashing) algorithm for finding a near neighbor or closest ne...

Nearest Neighbor rendering in Canvas

I have a sprite that animates using a sprite sheet. He is only 16x16, but I want to scale him up to around 64x64 in all its pixel-y goodness! The results are terrible, of course the browser is anti aliasing it. :/ Thanks! ...

nearest neighbor 2 dimensions

Given a set S of points in 2-dimensional space, provide an algorithm that computes nearest neighbor(euclidian) for each point in the set. I think its called nearest neighbor graph, isn't it? Any existing efficient algorithm (N log N), where N = len(S)? ...

What's a good algorithm for nearest neighbour problem in two dimensions ?

I would like to build an app that's going to give you the closest restaurant depending on your location. We'll have a database with all the POI corresponding to the restaurant and we'll get your location with the GPS of your phone... What algorithm would be appropriate ? Where can I find good doc about it ? Thanks ...

Clustering problem

Hi all I've been tasked to find N clusters containing the most points for a certain data set given that the clusters are bounded by a certain size. Currently, I am attempting to do this by plugging in my data into a kd-tree, iterating over the data and finding its nearest neighbor, and then merging the points if the cluster they make do...

How to find the closest 2 points in a 100 dimensional space with 500,000 points?

I have a database with 500,000 points in a 100 dimensional space, and I want to find the closest 2 points. How do I do it? Update: Space is Euclidean, Sorry. And thanks for all the answers. BTW this is not homework. ...

Suitable choice of data structure and algorithm for fast k-Nearest Neighbor search in 2D

I have a dataset of approximately 100,000 (X, Y) pairs representing points in 2D space. For each point, I want to find its k-nearest neighbors. So, my question is - what data-structure / algorithm would be a suitable choice, assuming I want to absolutely minimise the overall running time? I'm not looking for code - just a pointer towar...