[ 
https://issues.apache.org/jira/browse/MAHOUT-353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851581#action_12851581
 ] 

Rajat Tibrewal commented on MAHOUT-353:
---------------------------------------

columnVector is initialized in the CooccurrenceCache constructor which in turn 
in invoked in the configure() of RecommenderMapper at line 90 and used later as 
"retriever" in cooccurrencecache (which is of type Cache).

So assuming that configure() IS invoked (without which columnVector wont be 
initialized), your observation of "not able to load a column vector that was 
previously generated" can be possibly inspected at the invocation of: 
cooccurrenceColumnCache = new Cache<IntWritable,Vector>(new 
CooccurrenceCache(cooccurrenceColumnMap), 100);

Maybe decoupling this statement as below might help:
cocache = new CooccurrenceCache(cooccurrenceColumnMap);
cooccurrenceColumnCache = new Cache<IntWritable,Vector>(cooccurencecache, 100);

where cocache be a class variable of RecommenderMapper of type 
CooccurrenceCache.

Again, this is just a hunch! Sorry to disturb if it doesnt work :)

> java.lang.NullPointerException in RecommenderMapper
> ---------------------------------------------------
>
>                 Key: MAHOUT-353
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-353
>             Project: Mahout
>          Issue Type: Bug
>          Components: Collaborative Filtering
>    Affects Versions: 0.4
>            Reporter: Hui Wen Han
>             Fix For: 0.4
>
>
> java.lang.NullPointerException
>       at 
> org.apache.mahout.cf.taste.hadoop.item.RecommenderMapper$CooccurrenceCache.get(RecommenderMapper.java:169)
>       at 
> org.apache.mahout.cf.taste.hadoop.item.RecommenderMapper$CooccurrenceCache.get(RecommenderMapper.java:154)
>       at 
> org.apache.mahout.cf.taste.impl.common.Cache.getAndCacheValue(Cache.java:125)
>       at org.apache.mahout.cf.taste.impl.common.Cache.get(Cache.java:94)
>       at 
> org.apache.mahout.cf.taste.hadoop.item.RecommenderMapper.map(RecommenderMapper.java:111)
>       at 
> org.apache.mahout.cf.taste.hadoop.item.RecommenderMapper.map(RecommenderMapper.java:52)
>       at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
>       at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:358)
>       at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
>       at org.apache.hadoop.mapred.Child.main(Child.java:170)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to