根据说明,numpy.linalg.lstsq rcond参数不起作用吗? [英] Is the numpy.linalg.lstsq rcond parameter not working according to the description?

查看:389
本文介绍了根据说明,numpy.linalg.lstsq rcond参数不起作用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用numpy中的最小二乘解法(

将rcond参数设置为无":

vector = np.linalg.lstsq(GA, FA, rcond = None)

它返回一个错误:

TypeError: must be real number, not NoneType

删除参数或将其设置为-1时不会发生.

我做了一些检查,并根据此解决方案

您需要NumPy> = 1.14.您使用的是什么版本?

I am trying to use the least squares solution from numpy (Description). According to the website to use the new default for the 'rcond' parameter: ''To silence the warning and use the new default, use rcond=None, to keep using the old behavior, use rcond=-1.''

With the rcond parameter set to None:

vector = np.linalg.lstsq(GA, FA, rcond = None)

It returns me an error:

TypeError: must be real number, not NoneType

Which does not happen when the parameter is taken away or set to -1.

I did some check and according to this post and one of the answers had an update stating that there were some recent changes on this method.

Then I would like to ask if someone else is having the same problem or if there is something as a typo on my line (Or something else I haven't thought about).

Kind Regards, Thanks for your time.

解决方案

You need NumPy >= 1.14. What version are you using?

这篇关于根据说明,numpy.linalg.lstsq rcond参数不起作用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆