0

I want to add a recommendation system (collaborative filtering in particular) into my Android application. I have already created the backend using django rest API.

Now i'm not sure as to where should i incorporate the recommendation engine.I look around and came to know about django-recommender package, but i'm not sure how well it handles large amount of data.Or should i go for some big data option , i've already worked on HPCC platform.

If yes, how should I integrate it with my app.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
  • Please elaborate on "large amount of data" – user1797792 Oct 26 '15 at 08:57
  • Well I'm not sure about how much data it will handle later.I'm just being cautious to avoid scalability issues in future – tapas kumar Mahanta Oct 26 '15 at 09:02
  • I wouldn't worry about it at this time. I don't know which database you're using, but Postgres/mySql can handle millions of records with ease, it's what they're built for, HPCC sounds like overkill. You'll end up spending way too much time on making your app scalable. It will take a while before basic SQL-database can't handle the amount of load. – user1797792 Oct 26 '15 at 09:19
  • ok cool ,i'm using postgres db , so for collaborative filtering implementation should i go for django based libraries like django-recommender or crab ?? – tapas kumar Mahanta Oct 26 '15 at 09:24
  • Seems like django-recommender is not being developed anymore (last checkin in 2008), so wouldn't recommend it. Either find another solution or build your own – user1797792 Oct 26 '15 at 09:29
  • You can check `prediction.io` or something similar. If you can build a rest-api for your recommendation system, then you only need an active internet connection which your app should use. – Turcia Nov 03 '15 at 18:45

1 Answers1

0

First you need to have an API ready with the required recommender algorithms implemented (the engine). It is common to access this API from your Android app by sending HTTP requests to the endpoint (see how to send HTTP requests in Android).

Now there are two ways to get access to a recommender engine.

  1. Build it yourself - this often involves doing extensive research on the several method, learning a new programming language (e.g. Neo4J, etc.) and implementing and hosting this engine (monthly fees can be quite high)

  2. Tap into Recommender Algorithms as a Service libraries such as the Abracadabra Recommender API. The setup is very straightforward: you only need to send HTTP calls to the API to train your model and to receive recommendations. View the docs.

With the Abracadabra Recommender API, when using Java, you first add data to your model:

// These code snippets use an open-source library. http://unirest.io/java
HttpResponse<JsonNode> response = Unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/add/subjects?recommenderId=rec1&subjectId=See+docs")
.header("X-Mashape-Key", "<required>")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.asJson();

Then you train the model by rating or liking subjects (for instance movies):

// These code snippets use an open-source library. http://unirest.io/java
HttpResponse<JsonNode> response = Unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/rate/subject?recommenderId=rec1&subjectId=gameofthrones&subjectWeight=10&userId=user1")
.header("X-Mashape-Key", "<required>")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.asJson();

Once done, then you receive recommendations based on Content-Based, Collaborative or Hybrid filtering as follows:

// These code snippets use an open-source library. http://unirest.io/java
HttpResponse<JsonNode> response = Unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/recommend?method=content&recommenderId=rec1&userId=user1")
.header("X-Mashape-Key", "<required>")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.asJson();
Community
  • 1
  • 1
WJA
  • 6,676
  • 16
  • 85
  • 152