mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lastarsenal <lastarse...@163.com>
Subject Re:some confuse about SSVD in class ABtDenseOutJob
Date Thu, 21 May 2015 09:53:58 GMT
Hi, HongFei,


   
   You can print some variable like aRowCount, vecSize to check whey ArrayIndexOutOfBoundsException



At 2015-05-21 15:30:23, "zhonghongfei@yy.com" <zhonghongfei@yy.com> wrote:
>I've run the SSVDCLI with "-q 1" parameter, but I've got an java.lang.ArrayIndexOutOfBoundsException.

>
>I found that it's because when it's not a dense vector, i is the index of an Vector.Element
and this index is an item id,so it exceeds the vector size.
>My question is if there is a bug in ABtDenseOutJob?
>
>the following code is in ABtDenseOutJob --> ABtMapper --> map() : 
>
>if (vec.isDense()) { 
>for (int i = 0; i < vecSize; i++) { 
>extendAColIfNeeded(i, aRowCount + 1); 
>aCols[i].setQuick(aRowCount, vec.getQuick(i)); 
>} 
>} else if (vec.size() > 0) { 
>for (Vector.Element vecEl : vec.nonZeroes()) { 
>int i = vecEl.index(); // i is item id , so it will exceed the vec.size() usually, when
extendAColIfNeeded(i, aRowCount + 1) is called it will get an error
>extendAColIfNeeded(i, aRowCount + 1); 
>aCols[i].setQuick(aRowCount, vecEl.get()); 
>} 
>}
>
>So how to fix this proplem ?
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message