You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Dmitriy Lyubimov (JIRA)" <ji...@apache.org> on 2011/03/28 20:57:06 UTC

[jira] [Commented] (MAHOUT-638) Stochastic svd's is not handling well all cases of sparse vectors

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

Dmitriy Lyubimov commented on MAHOUT-638:
-----------------------------------------

is that the best way to do row-wise outer product computation (rows A and Q)?

{code}
      if ( (aRow instanceof SequentialAccessSparseVector) ||
          (aRow instanceof RandomAccessSparseVector )) {
        for ( Vector.Element el:aRow ) { 
          double mul=el.get();
          for ( int j =0; j < kp; j++ ) 
            btRow.setQuick(j, mul * qRow.getQuick(j));
          btKey.set(el.index());
          context.write(btKey, btValue);
        }
      } else { 
        int n = aRow.size();
        for (int i = 0; i < n; i++) {
          double mul = aRow.getQuick(i);
          for (int j = 0; j < kp; j++)
            btRow.setQuick(j, mul * qRow.getQuick(j));
          btKey.set(i);
          context.write(btKey, btValue);
        }
      }

{code}

> Stochastic svd's is not handling well all cases of sparse vectors 
> ------------------------------------------------------------------
>
>                 Key: MAHOUT-638
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-638
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.5
>            Reporter: Dmitriy Lyubimov
>            Assignee: Dmitriy Lyubimov
>             Fix For: 0.5
>
>
> The Mahout patch of the algorithm is not handling all types of sparse input efficiently. BtJob doesn't handle SequentialSparseVector in a way to pick only non-zero elements from initial input and QJob doesn't iterate over RandomAccessSparseVector correctly. With extremely sparse inputs (0.05% non-zero elements) that leads to a terrible inefficiency in the aforementioned jobs (QJob, BtJob).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira