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, return zero for all userCode, itemCode and rating values! #265

Closed
sososa1213 opened this issue Jul 16, 2018 · 0 comments
Closed

Error, return zero for all userCode, itemCode and rating values! #265

sososa1213 opened this issue Jul 16, 2018 · 0 comments

Comments

@sososa1213
Copy link

I need to retrieve values of userCode, itemCode and rating from "/movielens/ml-100k/ratings.txt".
I use this way

Resource resource = new Resource("librec.properties");
Configuration conf = new Configuration();
conf.addResource(resource);
Randoms.seed(1);
TextDataModel dataModel = new TextDataModel(conf);
dataModel.buildDataModel();
SparseMatrix trainMatrix = dataModel.getDataSplitter().getTrainData();
int count = trainMatrix.numRows();
 for (int i : trainMatrix.rows()) {
           	int userCode = (int) trainMatrix.get(i,0);
		int itemCode = (int) trainMatrix.get(i, 1);
		double rating = trainMatrix.get(i, 2);
}

when I print values is zero.
Any help to fix this error

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