def test_divergence(self, *args):
     learner = UserItemBaselineLearner()
     super().test_divergence(learner, filename=__dataset__)
 def test_input_data_continuous(self, *args):
     learner = UserItemBaselineLearner(verbose=True)
     super().test_input_data_continuous(learner, filename=__dataset__)
 def test_warnings(self, *args):
     learner = UserItemBaselineLearner()
     super().test_warnings(learner, filename=__dataset__)
 def test_swap_columns(self, *args):
     learner = UserItemBaselineLearner()
     super().test_swap_columns(learner,
                               filename1='ratings_dis.tab',
                               filename2='ratings_dis_swap.tab')
 def test_predict_items(self, *args):
     learner = UserItemBaselineLearner()
     super().test_predict_items(learner, filename=__dataset__)
 def test_input_data_discrete(self, *args):
     learner = UserItemBaselineLearner()
     super().test_input_data_discrete(learner, filename='ratings_dis.tab')
from PyQt4.QtGui import QApplication

from Orange.widgets.utils.owlearnerwidget import OWBaseLearner

from orangecontrib.recommendation import UserItemBaselineLearner

class OWUserItemBaseline(OWBaseLearner):
    # Widget needs a name, or it is considered an abstract widget
    # and not shown in the menu.
    name = "User-Item Baseline"
    description = 'This model takes the bias of users and items plus the ' \
                  'global average to make predictions.'
    icon = "icons/user-item-baseline.svg"
    priority = 80

    LEARNER = UserItemBaselineLearner

if __name__ == '__main__':
    app = QApplication([])
    widget = UserItemBaselineLearner()
    widget.show()
    app.exec()