yes I get zero. I've just figured that if I do it this way, it works fine:

public class ItemBasedBuilder implements RecommenderBuilder {

    @Override
    public Recommender buildRecommender(DataModel dataModel) throws
TasteException {
        UserSimilarity userSimilarity = new
PearsonCorrelationSimilarity(dataModel);
        UserNeighborhood neighborhood =
                new NearestNUserNeighborhood(10, userSimilarity, dataModel);
        Recommender recommender =
                new GenericUserBasedRecommender(dataModel, neighborhood,
userSimilarity);
        return recommender;

    }
}

but these two solution should give the same result I guess...


srowen wrote:
> 
> This looks fine to me (though you are building a user-based
> recommender, and from the sound of it, you intended to build an
> item-based one). You are getting an evaluation result of 0?
> 
> Are you using the latest code (version 0.2)?
> 
> Also, try increasing the amount of data you use. Your "0.8" can be
> "0.95" to train on 95% of the data. Also, for a small data set like
> this, pass 1.0 as the last parameter to use all of it.
> 
> At the moment you're training on 16,000 ratings, which should still
> give some non-trivial result, but that's not a lot.
> 
> On Fri, Nov 20, 2009 at 11:15 AM, jamborta <[email protected]> wrote:
>>
>> thanks, i'm using this one with the standard movielens (100k) dataset.
>>
>>    public Recommender buildRecommender(DataModel dataModel) throws
>> TasteException {
>>        DataModel model = null;
>>        try {
>>            model = new FileDataModel(new File("./data/all_data.data"));
>>
>>        } catch (FileNotFoundException e) {
>>            e.printStackTrace();
>>        }
>>        UserSimilarity userSimilarity = new
>> PearsonCorrelationSimilarity(model);
>>        UserNeighborhood neighborhood =
>>                new NearestNUserNeighborhood(10, userSimilarity, model);
>>        Recommender recommender =
>>                new GenericUserBasedRecommender(dataModel, neighborhood,
>> userSimilarity);
>>        return recommender;
>>
>> }
>>
>>
>> srowen wrote:
>>>
>>> 0 is very good! But I agree, it is probably an error.
>>>
>>> I see you call evaluate() twice. This is not necessary. Call it once,
>>> and save the result, then print it. But this is not the issue.
>>>
>>> What is in the ItemBasedBuilder class? what is your data like? Maybe
>>> if I can see this I can suggest why you get this result.
>>>
>>> On Thu, Nov 19, 2009 at 5:31 PM, jamborta <[email protected]> wrote:
>>>>
>>>> hi.
>>>>
>>>> i'm not sure if this is a bug or I do somthing wrong, but when I try to
>>>> evaluate a system it returns 0 as a result. I'm using this piece of
>>>> code:
>>>>
>>>>            DataModel model = new FileDataModel(new
>>>> File("./data/all_data.data"));
>>>>            RecommenderBuilder build = new ItemBasedBuilder();
>>>>            AverageAbsoluteDifferenceRecommenderEvaluator evaluate = new
>>>> AverageAbsoluteDifferenceRecommenderEvaluator();
>>>>            DataModelBuilder model2 = null;
>>>>            evaluate.evaluate(build, model2, model,0.8,0.2 );
>>>>            System.out.println(evaluate.evaluate(build, model2,
>>>> model,0.8,0.2 ));
>>>>
>>>> thanks a lot.
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/evaluating-recommender-systems-tp26421408p26421408.html
>>>> Sent from the Mahout User List mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/evaluating-recommender-systems-tp26421408p26438752.html
>> Sent from the Mahout User List mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/evaluating-recommender-systems-tp26421408p26443610.html
Sent from the Mahout User List mailing list archive at Nabble.com.

Reply via email to