Wine Recommendation system

Ahrorjon Haidarov
3 min readMar 1, 2024

--

vino.com is one of the big online marketplace in the World. We will make recommendation system based on Wines database

First of all we need to make sure our steps:

  1. Data collecting
  2. Data analyzing
  3. Machine learning
  4. Conclusion

Get started

1. Data collecting

I have already collected data from vino.com web-site.

I used python libraries for collecting data:

  • selenium
  • bs4
  • requests

2. Data analyzing

Let’s summarize the dataset

There is distribution of wines count by its aromas.

According the plot the most wines are:

  1. “Fruity”
  2. “Floral”

There is distribution of vino types by their mean price.

The graph shows that “Sparkling” and “Fortified” wines’ mean price are higher than other type of wines.

This graph shows top 10 expensive wines.

The most expensive wine:

  • “Sauternes AOC 1er Cru Classé Supérieur 2018 Château d’Yquem”

The distribution of wines count by it’s alcohol content and format

The most wines format is “0.75” and alcohol content is “Between 10% and 15%”

Distribution of wines count by Country

Graph shows that most wines made in “Italy”

4. Machine learning

Before machine learning part we should prepare our data for ML.

So I collected some features of wine in one table and converted it into numeric vector format.

Now our data is ready for ML. Next we should select an algorithm for building recommendation system.

I chose Content-Based filtering for recommender system. Next step is create matrix consist of cosine similarity.

The ‘get_recommendations’ function will returns recommendation according input_data if cosine similarity of it’s more than 60%.

Next step is getting input data from user and display the recommendation. Here an example:

Then we will ask user for liked wine’s id and after we will display more information about that wine.

Here an example:

4. Conclusion

The thing is python is powerful tool for Machine Learning. I did it easily with python’s libraries. At the end of the word, I want to say that it was only an example project, I don’t recommend you to consume these products.

--

--