我试图用来scipy.interpolate.LinearNDInterpolator()在 8 维空间中插入数据点,但遇到了一个我不明白的错误:
scipy.spatial.qhull.QhullError: QH6154 Qhull precision error: Initial simplex is flat (facet 1 is coplanar with the interior point)
Run Code Online (Sandbox Code Playgroud)
接下来是更多的文字,我将在下面发布。使用我可以在网上找到的内容,我无法解决代码中的错误。这一切对我来说都是正确的(我只复制了相关部分):
from scipy import interpolate as inter
from numpy import array
npPoints = array(points)
npS = array(s)
inter.LinearNDInterpolator(npPoints, npS)
Run Code Online (Sandbox Code Playgroud)
其中points是一个 Nx8 嵌套的浮点数列表,s是一个 Nx1 的浮点数列表,两者都是之前定义的。
从我在文档中看到的,在我看来我做得对。我的错误在哪里?我应该使用不同的方法吗?
这是完整的 Qhull 错误:
Traceback (most recent call last):
File "BellDataFit", line 83, in <module>
inter.LinearNDInterpolator(npPoints, npS)
File "interpnd.pyx", line 248, in scipy.interpolate.interpnd.LinearNDInterpolator.__init__
File "qhull.pyx", line …Run Code Online (Sandbox Code Playgroud)