irecsys / CARSKit

Java-Based Context-aware Recommendation Library
https://carskit.github.io/
GNU General Public License v3.0
124 stars 53 forks source link

Error when using DCW and DCR #6

Closed basvank closed 8 years ago

basvank commented 8 years ago

Hi,

I recently tried out the newly added DCW and DCR algorithms but I am getting an error in the ContextSimilarity() function in DCW and ContextRelaxation() function in DCR. The error is java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 and happens in conds1.get(i) in both function classes.

Can you check if you get the same error as well? Or, if not, let me know what settings and data file you use so that I can check if it's a problem on my side?

Thanks for the help!

irecsys commented 8 years ago

I didn't get errors. Can you provide more details? which data were you using? what's your setting

On Tuesday, June 7, 2016, basvank notifications@github.com wrote:

Hi,

I recently tried out the newly added DCW and DCR algorithms but I am getting an error in the ContextSimilarity() function in DCW https://github.com/irecsys/CARSKit/blob/master/src/carskit/alg/cars/transformation/hybridfiltering/DCW.java#L329 and ContextRelaxation() function in DCR https://github.com/irecsys/CARSKit/blob/master/src/carskit/alg/cars/transformation/hybridfiltering/DCR.java#L343. The error is java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 and happens in conds1.get(i) in both function classes.

Can you check if you get the same error as well? Or, if not, let me know what settings and data file you use so that I can check if it's a problem on my side?

Thanks for the help!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/irecsys/CARSKit/issues/6, or mute the thread https://github.com/notifications/unsubscribe/AHDB5wkW1g6oKe1Ygoz_FaKSq0lTBwFIks5qJTJMgaJpZM4Ivs2t .

Sent from Gmail Mobile

basvank commented 8 years ago

Hmm strange, I can indeed get it to work on the InCarMusic dataset. Unfortunately I am working on a dataset consisting of proprietary data so I cannot share that.

The only thing I can think of is the structure of the data set then.

Comparing this (for InCarData):

To this (my dataset):

Could it have something to do with the fact that it has only two context dimensions or because dimension context only has one condition? (this is due to the fact that this is context:na, I could try and make it pr:na and see if that works). Do you know if these algorithms work across context dimensions or only across context conditions?

basvank commented 8 years ago

I should note that I have used this dataset succesfully with several other algorithms (CAMF, CSLIM for example) so I don't think the error is due to an incorrect structure.

basvank commented 8 years ago

Ah, changing the context from context:na to pr:na seems to solve it. The statistics then become as follows:

So it seems the algorithm can't handle a single context condition within a dimension.

I'm letting it run now to be sure it completes successfully.

basvank commented 8 years ago

Next error now, java.lang.IllegalArgumentException: fromIndex(0) > toIndex(-1) in predict() because I have num.neighbors=-1.

I have changed this line to k = (k > knn && knn > 0) ? knn : k; which solves this particular error and it's running again now...

basvank commented 8 years ago

All working just fine now!