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

problem with epinions dataset #161

Closed
hphphphphp opened this issue Jun 12, 2017 · 1 comment
Closed

problem with epinions dataset #161

hphphphphp opened this issue Jun 12, 2017 · 1 comment

Comments

@hphphphphp
Copy link

hi;
here is my code but Does not produce anything just for epinions dataset.

Configuration conf = new Configuration();

    //	Resource resource = new Resource("rec/context/rating/trustsvd-test.properties");

// conf.addResource(resource);
conf.set("dfs.data.dir", "../data");

//conf.set("data.input.path", "filmtrust");
conf.set("data.input.path", "epinions");

// conf.set("data.splitter.ratio", "rating");
// conf.set("data.splitter.trainset.ratio", "0.8");

    conf.set("rec.factor.number", "10");
    conf.set("rec.iterator.maximum", "10");

         conf.set("rec.recommender.similarity.key" ,"user");
        conf.set("data.appender.class", "social");
    conf.set("data.appender.path", "test/test-append-dir");

Randoms.seed(1);
    TextDataModel dataModel = new TextDataModel(conf);
    dataModel.buildDataModel();

                RecommenderSimilarity similarity = new PCCSimilarity();
    similarity.buildSimilarityMatrix(dataModel);

    // get similarity values
    int numUser = ((SparseMatrix)dataModel.getTrainDataSet()).numRows();
    SymmMatrix similarityMatrix = similarity.getSimilarityMatrix();

    for (int i=0; i<numUser; i++) {
        for (int j=0; j<numUser; j++) {
            System.out.println("user_" + i + ", user_" + j + ", similarity: " + similarityMatrix.get(i, j));
        }
    }
@SunYatong
Copy link
Collaborator

SunYatong commented Jun 12, 2017

It seems that you are using the rating file of Epinions with the trust file of FilmTrust.
Try this :

        conf.set("data.input.path", "epinions/rating");
        conf.set("data.appender.path" ,"epinions/trust");

And You may wish to take advantage of our documentation and the debug tools of your IDE ^_^

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