biolab/orange3-recommendation

Name: orange3-recommendation

Owner: Bioinformatics Laboratory

Description: ? :thumbsdown: Add-on for Orange3 to support recommender systems.

Created: 2016-08-16 13:09:51.0

Updated: 2017-11-30 10:39:44.0

Pushed: 2016-11-24 21:14:45.0

Homepage:

Size: 12529

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Orange3-Recommendation

Build Status codecov Documentation Status Codacy Badge

Orange3 Recommendation is a Python module that extends Orange3 to include support for recommender systems.

For more information, see our documentation

Dependencies

Orange3-Recommendation is tested to work under Python 3.

The required dependencies to build the software are Numpy >= 1.9.0 and Scikit-Learn >= 0.16

Install

This package uses distutils, which is the default way of installing python modules. To install in your home directory, use:

python setup.py install --user

To install for all users on Unix/Linux::

python setup.py build
sudo python setup.py install

For development mode use:

python setup.py develop
Scripting

All modules can be found inside orangecontrib.recommendation.*. Thus, to import all modules we can type:

from orangecontrib.recommendation import *

Rating pairs (user, item):

Let's presume that we want to load a dataset, train it and predict its first three pairs of (id_user, id_item)

import Orange
from orangecontrib.recommendation import BRISMFLearner
data = Orange.data.Table('movielens100k.tab')
learner = BRISMFLearner(num_factors=15, num_iter=25, learning_rate=0.07, lmbda=0.1)
recommender = learner(data)
prediction = recommender(data[:3])
print(prediction)
>>> [ 3.79505151  3.75096513  1.293013 ]

Recommend items for set of users:

Now we want to get all the predictions (all items) for a set of users:

import numpy as np
indices_users = np.array([4, 12, 36])
prediction = recommender.predict_items(indices_users)
print(prediction)
>>> [[ 1.34743879  4.61513578  3.90757263 ...,  3.03535099  4.08221699 4.26139511]
     [ 1.16652757  4.5516808   3.9867497  ...,  2.94690548  3.67274108 4.1868596 ]
     [ 2.74395768  4.04859096  4.04553826 ...,  3.22923456  3.69682699 4.95043435]]
Performance

See performance section in the documentation.

Relevant links


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.