# What's the best classification model for this recommendation engine?

I'm not a data scientist but I'm trying to implement a recommendation engine on my company. My application runs on PHP but I'll use Python to process this data.

My company is an online school, with 40 online courses as of now. I have a CSV file with around 30k users preferences, and it looks like this:

0 means that user is not subscribed (I consider here that he has no interest), while 1 means subscribed (interested).

My idea is to compare one single user array such as [0,1,0,0,0,1,1...] with all this data and return a grade for each course with the probability of interest for this user.

I was thinking of using a Multinomial Logistic Regression, but as far as I know (and I don't know much) it would return me a binary result, right?

What classification model would you recommend me to use? Ideally, my result should be something like:

[0.95, 0.1, 0.54, 0.3, 0.87...]

Cheers!

• Formulate the problem as a Collaborative filtering task. – Fadi Bakoura May 21 '18 at 14:52
• Thanks @FadiBakoura, will research on this and let you know. – grpaiva May 21 '18 at 18:03
• Can you include more information about the user? (sex, age ...) An user single with 18 years old may like a course that another 50 years old do not like ... – Intruso Aug 20 '18 at 13:50
• Seems like a prediction problem, not one of classification, so a neural network? Have you tried loading this data into Orange3? Seems you could test out your models pretty quickly. Orange3 uses Scikit, so once you find your workflow, you can use Python. By the way, if it is a neural network solution, TensorFlow has PHP bindings, so you could do the whole thing in PHP. Both may save you time. – davmor Nov 18 '18 at 11:10

If you want your classifier to return a vector of probabilities, then if you're using the sklearn library, you could use the predict_proba method.
from sklearn.datasets import load_digits

• Thanks for your answer @Lupacante! What I don't get here is that when I print digits.data.shape and digits.target.shape I get: (360, 64) and (360,). Shouldn't the target shape be something like(64,)? My dataset's shape looks like this: (27920, 46) and (46,). I'm getting an error: ValueError: Found input variables with inconsistent numbers of samples: [27920, 46] – grpaiva May 21 '18 at 18:02
• The predictors and target from the training set should have the same number of rows. The first number in the tuple returned by shape gives you the number of rows, so (360, 64) and (360,) is exactly what we'd expect. – ignoring_gravity May 22 '18 at 8:16