2

I am developing a website, which will recommend recipes to the visitors based on their data. I am collecting data from their profile, website activity and facebook.

Currently I have data like [username/userId, rating of recipes, age, gender, type(veg/Non veg), cuisine(Italian/Chinese.. etc.)]. With respect to above features I want to recommend new recipes which they have not visited.

I have implemented ALS (alternating least squares) spark algorithm. In this we have to prepare csv which contains [userId,RecipesId,Rating] columns. Then we have to train this data and create the model by adjusting parameters like lamdas, Rank, iteration. This model generated recommendation, using pyspark

model.recommendProducts(userId, numberOfRecommendations)

The ALS algorithm accepts only three features userId, RecipesId, Rating. I am unable to include more features (like type, cuisine, gender etc.) apart from which I have mentioned above (userId, RecipesId, Rating). I want to include those features, then train the model and generate recommendations.

Is there any other algorithm in which I can include above parameters and generate recommendation.

Any help would be appreciated, Thanks.

3 Answers3

2

Yes, there are couple of others algorithms. For your case, I would suggest that you Naive Bayes algorithm.

https://en.wikipedia.org/wiki/Naive_Bayes_classifier

Since you are working on a web application, a JS solution, I guess, would come handy to you.

(simple) https://www.npmjs.com/package/bayes

or for example:

(a bit more powerful) https://www.npmjs.com/package/naivebayesclassifier

Peter Stegnar
  • 12,615
  • 12
  • 62
  • 80
1

There are algorithms called recommender systems in machine learning. In this we have content based recommender systems. They are mainly used to recommend products/movies based on customer reviews. You can apply the same algorithm using customer reviews to recommend recipes. For better understanding of this algorithm refer this links:

https://www.youtube.com/watch?v=Bv6VkpvEeRw&list=PL0Smm0jPm9WcCsYvbhPCdizqNKps69W4Z&index=97

https://www.youtube.com/watch?v=2uxXPzm-7FY

You can go with powerful classification algorithms like

->SVM: works very well if you have more number of attributes.

->Logistic Regression: if you have huge data of customers.

1

You are looking for recommender systems using algorithms like collaborative filtering. I would suggest you to go through Prof.Andrew Ng's short videos on collaborative filtering algorithm and low-rank matrix factorization and also building recommender systems. They are a part of Coursera's Machine learning course offered by Stanford University. The course link: https://www.coursera.org/learn/machine-learning#%20

You can check week 9 for the content related to recommender systems.

Rohit
  • 67
  • 5