pyFM icon indicating copy to clipboard operation
pyFM copied to clipboard

Incorrect format

Open asmitapoddar opened this issue 7 years ago • 5 comments

I am trying to use libFM n the Frappe dataset. However, I get the following error on running the code:

Original exception was: Traceback (most recent call last): File "fm.py", line 19, in (train_data, y_train, train_users, train_items)=loadData("traindata.mat") File "fm.py", line 11, in loadData for line in f: File "/usr/lib/python3.5/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xda in position 133: invalid continuation byte

Is there some problem in the input format of the training and/or test dataset? My training and test dataset are in the .mat format

asmitapoddar avatar May 12 '17 09:05 asmitapoddar

Hey,

It might be an issue with the input format. You want to look at some of the solutions here - http://stackoverflow.com/questions/19699367/unicodedecodeerror-utf-8-codec-cant-decode-byte

bhavika avatar May 12 '17 16:05 bhavika

I used .txt files as input. I ran pyFM on the Frappe data set, where the training and test data set contain the columns: user_id, app_id, rating and context_id (the rating is 1 for each row) and I get FM MSE of 0.0000. Does pyFM work on files with binary ratings?

asmitapoddar avatar May 15 '17 03:05 asmitapoddar

Does pyFM work on files with binary ratings?

It should. Do you have a link to the Frappe dataset?

bhavika avatar May 15 '17 03:05 bhavika

Yes, this is the link: http://baltrunas.info/data/CARS2_code.zip cars2_frappe_datasplit.mat contain the training, test and validation dataset. Please let me know if the problem is identified.

asmitapoddar avatar May 15 '17 04:05 asmitapoddar

How should the the variable preds look? Should it be a vector containing the recommended item_ids?

asmitapoddar avatar Jun 15 '17 07:06 asmitapoddar