Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using DCW and DCR #6

Closed
basvank opened this issue Jun 7, 2016 · 6 comments
Closed

Error when using DCW and DCR #6

basvank opened this issue Jun 7, 2016 · 6 comments

Comments

@basvank
Copy link

basvank commented Jun 7, 2016

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
Copy link
Owner

irecsys commented Jun 7, 2016

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
#6, or mute the thread
https://github.com/notifications/unsubscribe/AHDB5wkW1g6oKe1Ygoz_FaKSq0lTBwFIks5qJTJMgaJpZM4Ivs2t
.

Sent from Gmail Mobile

@basvank
Copy link
Author

basvank commented Jun 7, 2016

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):

  • Statistics of U-I-C Matrix:
  • User amount: 42
  • Item amount: 139
  • Rate amount: 3938
  • Context dimensions: 8 (drivingstyle, landscape, mood, naturalphenomena, roadtype, sleepiness, trafficconditions, weather)
  • Context conditions: 35 (drivingstyle: 3, landscape: 5, mood: 6, naturalphenomena: 5, roadtype: 4, sleepiness: 3, trafficconditions: 4, weather: 5)
  • Context situations: 28
  • Data density: 0.0006%
  • Scale distribution: [0.0 x 122, 3.0 x 652, 2.0 x 705, 1.0 x 1452, 4.0 x 513, 5.0 x 494]
  • Average value of all ratings: 2.447647
  • Standard deviation of all ratings: 1.474440
  • Mode of all rating values: 1.000000
  • Median of all rating values: 2.000000

To this (my dataset):

  • Statistics of U-I-C Matrix:
  • User amount: 8385
  • Item amount: 51
  • Rate amount: 9456
  • Context dimensions: 2 (pr, context)
  • Context conditions: 13 (pr: 12, context: 1)
  • Context situations: 13
  • Data density: 0.1668%
  • Scale distribution: [1.0 x 9456]
  • Average value of all ratings: 1.000000
  • Standard deviation of all ratings: 0.000000
  • Mode of all rating values: 1.000000
  • Median of all rating values: 1.000000

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
Copy link
Author

basvank commented Jun 7, 2016

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
Copy link
Author

basvank commented Jun 7, 2016

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

  • Statistics of U-I-C Matrix:
  • User amount: 8385
  • Item amount: 51
  • Rate amount: 9456
  • Context dimensions: 1 (pr)
  • Context conditions: 13 (pr: 13)
  • Context situations: 13
  • Data density: 0.1540%
  • Scale distribution: [1.0 x 9456]
  • Average value of all ratings: 1.000000
  • Standard deviation of all ratings: 0.000000
  • Mode of all rating values: 1.000000
  • Median of all rating values: 1.000000

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
Copy link
Author

basvank commented Jun 7, 2016

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
Copy link
Author

basvank commented Jun 7, 2016

All working just fine now!

@basvank basvank closed this as completed Jun 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants