# spark-user mailing list archives

##### Site index · List index
Message view
Top
From Debasish Das <debasish.da...@gmail.com>
Subject Re: Solving linear equations
Date Wed, 22 Oct 2014 23:33:05 GMT
```Hi Martin,

This problem is Ax = B where A is your matrix [2 1 3 ... 1; 1 0 3 ...;....]
and x is what you want to find..B is 0 in this case...For mllib normally
this is label....basically create a labeledPoint where label is 0 always...

Use mllib's linear regression and solve the following problem:

min ||Ax - B||_{2}^{2} + lambda||x||_{2}^{2}

Put a small regularization to condition the problem (~1e-4)...and play with
some options for learning rate in linear regression...

The parameter vector that you get out of mllib linear regression is the
answer to your linear equation solver...

Thanks.
Deb

On Wed, Oct 22, 2014 at 4:15 PM, Martin Enzinger <martin.enzinger@gmail.com>
wrote:

> Hi,
>
> I'm wondering how to use Mllib for solving equation systems following this
> pattern
>
> 2*x1 + x2 + 3*x3 + .... + xn = 0
> x1 + 0*x2 + 3*x3 + .... + xn = 0
> ..........
> ..........
> 0*x1 + x2 + 0*x3 + .... + xn = 0
>
> I definitely still have some reading to do to really understand the direct
> solving techniques, but at the current state of "knowledge" SVD could help
> me with this right?
>
> Can you point me to an example or a tutorial?
>
> best regards
>

```
Mime
View raw message