我必须开发一个数据监听函数,在这个函数中,我把熊猫数据帧中的数据集分成更小的部分,然后在那里插值一个三次样条曲线(在我的例子中是Z值)。为此,我使用了scipy
中的interpolate.interp2d
函数,然后从估计值中减去给定的高度值,得到残差,在这里我可以应用一个3西格玛阈值,并删除具有最高离群值的行。在
但当我运行代码时,我会收到以下警告:
/home/mattes/anaconda3/lib/python3.6/site-packages/scipy/interpolate
/_fitpack_impl.py:976: RuntimeWarning: The maximal number of iterations
(20) allowed for finding smoothing
spline with fp=s has been reached. Probable cause: s too small.
(abs(fp-s)/s>0.001)
kx,ky=3,3 nx,ny=18,21 m=915 fp=221.198171 s=0.000000
warnings.warn(RuntimeWarning(_iermess2[ierm][0] + _mess))
/home/mattes/anaconda3/lib/python3.6/site-packages/scipy/interpolate
/_fitpack_impl.py:976: RuntimeWarning: A theoretically impossible result
when finding a smoothing spline
with fp = s. Probable causes: s too small or badly chosen eps.
(abs(fp-s)/s>0.001)
kx,ky=3,3 nx,ny=19,22 m=914 fp=209.480429 s=0.000000
warnings.warn(RuntimeWarning(_iermess2[ierm][0] + _mess))
/home/mattes/anaconda3/lib/python3.6/site-packages/scipy/interpolate
/_fitpack_impl.py:976: RuntimeWarning: No more knots can be added because
the number of B-spline
coefficients already exceeds the number of data points m.
Probable causes: either s or m too small. (fp>s)
kx,ky=3,3 nx,ny=26,46 m=911 fp=158.754387 s=0.000000
warnings.warn(RuntimeWarning(_iermess2[ierm][0] + _mess))
这是我创建的代码:
^{pr2}$我用sigme_size 3和step_size=50计算样条曲线时有足够的数据点。此外,除了消除了数据点之外,使用函数后,异常值仍然存在。在
有人知道如何解决这个问题吗?在
非常感谢!在
目前没有回答
相关问题 更多 >
编程相关推荐