mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Runo <>
Subject Getting itemIDs out of a dataModel?
Date Fri, 04 Feb 2011 22:33:08 GMT
Hello -

I took a quick stab at precomputing item-item similarities recently,
and it seems like I'm not getting the itemIDs that I should be:

 Iterator iter = dataModel.getItemIDs();
 while( iter.hasNext() ){
    long item1 = (Long);

    Iterator inner = dataModel.getItemIDs();
    while( inner.hasNext() ){
        long item2 = (Long);
                  new GenericItemSimilarity.ItemItemSimilarity(item1,
item2, itemSimilarity.itemSimilarity(item1, item2))

I get an itemID that is not found in my input data at all. I do,
however, find it as a userID. My data is currently a flat file:


for example..


I can only assume that this is not the proper way to loop through all
the itemIDs inside the dataModel. How would you do that? I'd expect to
get 705540 from the line above..

Thanks for your time!

Matthew Runo

View raw message