Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Using Python to get a solution to a system of linear equations with as many zeros as possible in the solution

$
0
0

I'm trying to solve a linear system of equations in Python with a very sparse, relatively big matrix (size around 10 x 10000). Using Numpy, it was easy to get a numerical solution using the least squares method. However, it has next to no zeros in it, meaning the result is a linear combination of thousands of vectors.

I also tried using SciPy, so that I could try to tinker with the parameters to maximize the number of zeros, but I don't know it well at all, and am not sure if there's a way to do it with so many variables at once.

Basically, my question then is: is there a way to either (1) specify to Numpy that I want as many zeros as possible in the solution (instead of the usual norm minimization); or (2) solve big systems directly in SciPy?

Thanks in advance for any help!


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>