Search code examples
pythonscikit-learnknnnearest-neighborrecommendation-engine

Find the nearest neighbour with more than 3 dimension


I have a database with 2000 data and 15 features(columns) and I want to make a recommendation system to recommend me most similar row with the row that I've chosen.

For example, I want to find the most similar row with row 150 in my database.

which algorithm do you recommend to help me with this project?

Does KNN practical for this question?


This is one row of my data :

name1 = 12\241\42\0.4\0.5 ... \241

As you see all of my datasets are numeric except name column.


Solution

  • It seems like KNN is what you are looking for. To implement a multi-dimensional KNN, I would suggest you look at the Euclidean distance equation:

    Euclidean distance

    This determines the distance of one 'row' to another. You can then calculate which 'k' rows are closest using this equation.