- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用 SciPy 的平滑单变量样条
from scipy.interpolate import UnivariateSpline
spl = UnivariateSpline(x, y)
我收到此错误消息。
/usr/lib/python3.5/site-packages/scipy/interpolate/fitpack2.py:222: UserWarning: The maximal number of iterations maxit (set to 20 by the program) allowed for finding a smoothing spline with fp=s has been reached: s too small. There is an approximation returned but the corresponding weighted sum of squared residuals does not satisfy the condition abs(fp-s)/s < tol. warnings.warn(message)
如何重新定义 maxit 参数?除了它是 scipy.odr.ODR 类中的关键字之外,我在 SciPy 手册中找不到任何内容。不过我运气不太好。
最佳答案
您无法更改此参数,它已在 FITPACK 代码深处修复:
https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack/curfit.f#L220
原则上,您可以修改 Fortran 源代码并重新编译 scipy,但这几乎肯定不是您想要做的。相反,您可以使用 UnivariateSpline(或 splrep)的 s
参数来查看在给定数据 x
和 的情况下是否获得有用的信息y
.
顺便说一句,ODR 与此无关。
关于Python:在 UnivariateSpline 中重新定义 maxit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40385040/
我尝试使用 SciPy 的平滑单变量样条 from scipy.interpolate import UnivariateSpline spl = UnivariateSpline(x, y) 我收到
我实现了 scipy.optimize.minimize,以最小化具有 128 个值的一维数组的 pandas 数据帧的增量值的平均值。 它似乎可以运行并执行一些操作,但它不会停止在 maxiter
在以下调用 optim()我希望得到 fn() 的评价和 gr() 之一, 因为 maxit=1 .然而,fn()和 gr()每次评估 7 次。 optim(par=1000, fn=function
pyspark.ml.classification 中 LogisticRegression 中使用的 maxIter 参数的作用是什么? mlor = LogisticRegression(maxI
我有一个简单的成本函数,我想使用 scipy.optimize.minimize 函数对其进行优化。 opt_solution = scipy.optimize.minimize(costFunct
我是一名优秀的程序员,十分优秀!