This week we dove a bit deeper into machine learning algorithms using numpy: Python library used for scientific computing. After reading Chapter 2 on making recommendations from Programming Collective Intelligence by Toby Segaran, we had to make our own recommendation engine.

What country should I travel next?

This was my question I was building recommendation engine for.

First I had to create a full list of countries I wanted to work with. Then create a separate array for each person I want to compare myself with and (each array having elements as values to how many times they visited each country on the list).

Then I had to count Euclidean distance (length of the array) comparing me with each of those people. Then find the minimum distance from me, which means that that person is my closest match.

And finally, once I have that person, loop through mine and her array to see if there are any countries that she’s been to and me not.

Leave a Reply

Your email address will not be published. Required fields are marked *