KarypisLab / SLIM

High-performance implementation of SLIM-based approaches for Top-N recommendation
112 stars 18 forks source link

AHRR = -nan when trying model selection #5

Closed murak038 closed 5 years ago

murak038 commented 5 years ago

I was performing model selection using the following code (pulled from the example provided in the UserGuide.ipynb):

import pandas as pd
from SLIM import SLIM, SLIMatrix

traindata = pd.read_csv('~/SLIM/SLIM_web_training.ijv', delimiter = ' ', header=None)
valdata = pd.read_csv('~/SLIM/SLIM_web_test.ijv', delimiter = ' ', header=None)
trainmat = SLIMatrix(traindata)
# initlaize the validation matrix using the training matrix
valmat = SLIMatrix(valdata, trainmat)

params = {'dbglvl':3, 
          'algo':'cd', 
          'nthreads':1, 
          'l1r':1., 
          'l2r':1.,
          'optTol':1e-7,
          'niters':100}

l1s = [0.0001,0.001,0.005,0.01,0.05, 0.1, 0.5, 1, 2, 4,10,20,30,40,50,60,70,80,90,100]
l2s = [0.0001,0.001,0.005,0.01,0.05, 0.1, 0.5, 1, 2,4,5,10,20,30,40,50,60,70,80,90,100]

model = SLIM()
model.mselect(params, trainmat, valmat, l1s, l2s, nrcmds=10)

The dataset is formatted exactly the same as the training and test set provided in the test folder. An example screenshot is provided below.

When I run model selection on the slim model, I get an output file that has an AHRR of -nan for all of the different hyperparameters that I tested. I provided the output.txt file below. I was wondering why the AHRR is -nan and how the code or data structure can be changed to fix the error and test the model's performance for various hyper parameters.

slim_output.txt

Screen Shot 2019-09-20 at 8 48 21 AM

Data structure: user_id item_id ratings

shuix007 commented 5 years ago

Hi Rohit,

Thanks for your feedback. Can you please provide this dataset so that I can reproduce the bug and figure out what is happening here?

Zeren Shui

murak038 commented 5 years ago

Here is a .zip file with the training and test set that I used for model selection.

SLIM Data.zip

shuix007 commented 5 years ago

Hi Rohit,

The bug is solved, please try again. Thanks again for your feedback.

Zeren Shui