Isssue at implementation

9 views
Skip to first unread message

Marcel Caraciolo

unread,
Aug 3, 2011, 9:32:48 AM8/3/11
to Scikit-Crab
I have a simple doubt:

We have lots of interfaces to fetch one user such as:

preferences_from_user (user_id)

item_ids_from_user (item_id)


But it would be faster in case of using numpy and scipy arrays to fetch multiple users data. So instead of  one user_id as parameter I could pass more than one:

preferences_from_user(np.array([user_id,user_id2,...])
item_ids_from_user(np.array([user_id,user_id2,...])


But there is a problem there's lot ofs code already implemented using the first case.  So what's the best strategy for this now ?

I was thinking about putting new interfaces, only putting the name in the plurals and the developer can implement their own. And what's the place ? In the BaseRecommender or only in the MatrixDataModel ?

What do you think ?


Regards,



--
Marcel Pinheiro Caraciolo
M.S.C. Candidate at CIN/UFPE

Marcel Caraciolo

unread,
Aug 3, 2011, 9:40:31 AM8/3/11
to Scikit-Crab
THe methods that would be added:

    def preferences_from_users(self, user_ids, order_by_id=True):
    def preferences_from_users(self, user_ids, order_by_id=True):
    def items_from_users(self, user_ids):
    def preferences_for_items(self, item_ids, order_by_id=True):
    def preference_value(self, user_id, item_ids):
    def set_preferences(self, user_ids, item_ids, values):
    def remove_preferences(self, user_ids, item_ids):

Marcel Caraciolo

unread,
Aug 3, 2011, 11:31:55 AM8/3/11
to Scikit-Crab
I decided to add those methods and in a future release we will work on merging those methods, OK ?

It will be easier.

Cheers,

Marcel

Bruno J. M. Melo

unread,
Aug 3, 2011, 5:41:20 PM8/3/11
to sciki...@googlegroups.com
While we have no stable release this time would be excellent to change the API without backward compatibility.

Any objections?

Regards,

On Wed, Aug 3, 2011 at 10:32 AM, Marcel Caraciolo <cara...@gmail.com> wrote:



--
Bruno J. M. Melo

Marcel Caraciolo

unread,
Aug 3, 2011, 11:51:30 PM8/3/11
to sciki...@googlegroups.com
Hi Bruno,

I faced a problem in this task, because my goal was to create faster queries at the data model. Imagine a way to do it in batch instead of interating at each item of the array of user_ids.

The problem is the structure returned  at them. Using numpy you would have an array with rows, where each row correspond to a array of tuples. It would be a little complex to handle . But i think it would work.

Marcel
Reply all
Reply to author
Forward
0 new messages