[SciPy-User] scipy.optimize.nnls - Incompatible Dimensions

Skipper Seabold jsseabold at gmail.com
Mon Feb 18 14:55:01 EST 2013


On Mon, Feb 18, 2013 at 2:45 PM, Calvin Morrison <mutantturkey at gmail.com>wrote:

> Hi,
>
> I am trying to use scipy's nnls function. Unfortunately I am getting
> an "incompatible dimensions error, but my dimensions look correct:
>
> >> print matrix.shape
> (13969, 4096)
>
> >> print counts.shape
> (4096,)
>
> >> solutions, rnorm = scipy.optimize.nnls(trained_matrix, counts)
> *** ValueError: incompatible dimensions
>
> Any ideas?
>

Ax is a vector of length 13969 not 4096. Maybe you want ||A.Tx - b||_2?

Skipper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20130218/9aaccebd/attachment.html>


More information about the SciPy-User mailing list