'Returns
self.user_preferences :  list [(item_id,preference)]
Return user\'s preferences, ordered by user ID (if order_by_id is True)
or by the preference values (if order_by_id is False), as an array.'

def preferences_from_user(self, user_id, order_by_id=True):

    preferences = self.preference_values_from_user(user_id)
    data = zip(self._item_ids, preferences.flatten())
    if order_by_id:
        return [(item_id, preference) for (item_id, preference) in data if (not np.isnan(preference))]
    else:
        return sorted([(item_id, preference) for (item_id, preference) in data if (not np.isnan(preference))], key=(lambda item: (- item[1])))
