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 message "the return value of "net.librec.recommender.RecommenderContext.getSimilarity()" is null" on itemknn #347

Closed
samiravaez opened this issue Feb 12, 2022 · 2 comments

Comments

@samiravaez
Copy link

samiravaez commented Feb 12, 2022

I can run almost all the algorithms without any errors, but this does not apply to algorithms "itemknn" and "userknn". For example, for the algorithm "itemknn", I encounter the following error message in both versions 2 and 3:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "net.librec.similarity.RecommenderSimilarity.getSimilarityMatrix()" because the return value of "net.librec.recommender.RecommenderContext.getSimilarity()" is null
        at net.librec.recommender.cf.ItemKNNRecommender.setup(ItemKNNRecommender.java:55)
        at net.librec.recommender.AbstractRecommender.recommend(AbstractRecommender.java:219)
        at net.librec.job.RecommenderJob.executeRecommenderJob(RecommenderJob.java:144)
        at net.librec.job.RecommenderJob.runJob(RecommenderJob.java:122)
        at net.librec.tool.driver.RecDriver.run(RecDriver.java:84)
        at net.librec.tool.driver.RecDriver.main(RecDriver.java:111)

Do these two algorithms require special different settings or anything else? Can somebody help please?

@rburke2233
Copy link
Contributor

You might not have specified rec.similarity.class in your properties file.

@samiravaez
Copy link
Author

samiravaez commented Feb 13, 2022

My problem is solved. I thought the properties file would be called automatically when the algorithms were called, , and I did not specify its path in the command.
Thank you

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