So

b =

0.89

0.42

0.0

0.88

0.97

The solution at the bottom is the solution to Ax = b solved using Gaussian elimination. I guess another question is, is there another way to solve this problem? I'm trying to solve the least squares fit with a huge A (5MM x 1MM)

x = inverse(A-transpose*A)*A-transose*b

but I didn't see any functions for matrix inversion

I suppose I can use an iterative solver but I didn't see that either which is why I chose the QR decomposition , solve for Q and then Q-transpose*b = d and the solve Lx = d which would give the solution. But I don't think this would work either since the matrices are local copies and not RDD data structures. Any advice would be appreciated...

Iman

P.S. I also looked in the linear regression class in the mlib but I haven't seen any examples with sparse matrix and sparse vectors as the input just 'Dataset' If you have a code example of this this would work??

On Tue, Nov 8, 2016 at 6:41 AM Iman Mohtashemi <iman.mohtashemi@gmail.com> wrote:

Hi Sean,Here you go:sparsematrix.txt =row, col ,val0,0,.420,1,.280,2,.891,0,.831,1,.341,2,.422,0,.233,0,.423,1,.983,2,.884,0,.234,1,.364,2,.97The vector is just the third column of the matrix which should give the trivial solution of [0,0,1]This translates to this which is correctThere are zeros in the matrix (Not really sparse but just an example)0.42 0.28 0.890.83 0.34 0.420.23 0.0 0.00.42 0.98 0.880.23 0.36 0.97Here is what I get for the Q and RQ: -0.21470961288429483 0.23590615093828807 0.6784910613691661-0.3920784235278427 -0.06171221388256143 0.5847874866876442-0.7748216464954987 -0.4003560542230838 -0.29392323671555354-0.3920784235278427 0.8517909521421976 -0.31435038559403217-0.21470961288429483 -0.23389547730301666 -0.11165321782745863R: -1.0712142642814275 -0.8347536340918976 -1.2276722256701570.0 0.7662808691141717 0.75533159116609840.0 0.0 0.7785210939368136When running this in matlab the numbers are the same but row 1 is the last row and the last row is interchanged with row 3On Mon, Nov 7, 2016 at 11:35 PM Sean Owen <sowen@cloudera.com> wrote:Rather than post a large section of code, please post a small example of the input matrix and its decomposition, to illustrate what you're saying is out of order.On Tue, Nov 8, 2016 at 3:50 AM im281 <iman.mohtashemi@gmail.com> wrote:I am getting the correct rows but they are out of order. Is this a bug or am

I doing something wrong?