用Python写个机器学习的线性回归算法的东西,在输出最佳拟合直线时报错
哪个大侠能帮忙解决下?
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
ax.plot(xCopy[:,1],yHat)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 4137, in plot
for line in self._get_lines(*args, **kwargs):
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 317, in _grab_next_args
for seg in self._plot_args(remaining, kwargs):
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 295, in _plot_args
x, y = self._xy_from_xy(x, y)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 213, in _xy_from_xy
bx = self.axes.xaxis.update_units(x)
File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 1336, in update_units
converter = munits.registry.get_converter(data)
File "C:\Python27\lib\site-packages\matplotlib\units.py", line 148, in get_converter
converter = self.get_converter(xravel[0])
converter = self.get_converter(xravel[0])
File "C:\Python27\lib\site-packages\numpy\matrixlib\defmatrix.py", line 305, in __getitem__
out = N.ndarray.__getitem__(self, index)
RuntimeError: maximum recursion depth exceeded
开始以为是递归深度问题,后来加了sys.setrecursionlimit(10000)运行ax.plot(xCopy[:,1],yHat)然后IDE就restart了。。
,确实是版本的问题,用1.3.0就好。