- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在浏览完所有在线文档和示例后,我无法找到一种方法来从 GPy 中提取有关置信度或预测区间的信息。模型。
我生成这样的虚拟数据,
## Generating data for regression
# First, regular sine wave + normal noise
x = np.linspace(0,40, num=300)
noise1 = np.random.normal(0,0.3,300)
y = np.sin(x) + noise1
## Second, an upward trending starting midway, with its own noise as well
temp = x[150:]
noise2 = 0.004*temp**2 + np.random.normal(0,0.1,150)
y[150:] = y[150:] + noise2
plt.plot(x, y)
然后估计一个基本模型,
## Pre-processing
X = np.expand_dims(x, axis=1)
Y = np.expand_dims(y, axis=1)
## Model
kernel = GPy.kern.RBF(input_dim=1, variance=1., lengthscale=1.)
model1 = GPy.models.GPRegression(X, Y, kernel)
但是,没有什么可以清楚地说明如何从那里继续......另一个问题 here尝试问同样的问题,但对于统计建模如此重要的元素来说,这个答案不再有效,而且似乎相当令人不满意。
最佳答案
给定一个模型和一组我们想要生成间隔的目标 x 值,您可以使用以下方法提取间隔:
intervals = model.predict_quantiles( X = target_x_vals, quantiles = (2.5, 97.5) )
您可以更改分位数参数以获得适当的宽度。该函数的文档位于:https://gpy.readthedocs.io/en/deploy/_modules/GPy/core/gp.html
关于Python统计模块: How to extract confidence/prediction intervals from GPy?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55927795/
我有两个 TIMESTAMP 和一个 INTERVAL。我想知道间隔有多少次适合时间戳之间的间隙。 减去两个 TIMESTAMP 得到一个 INTERVAL。 SELECT TIMESTAMP '20
我最近在 Tardos 和 Kleinberg 的算法设计的第 4 章中阅读了有关间隔调度算法的内容。为间隔调度问题提供的解决方案是这样的: Sort the n intervals based on
这个问题在这里已经有了答案: Stop setInterval call in JavaScript (9 个回答) 关闭 4 年前。 文档指出 clearInterval() 需要在 setInt
我希望能够使用一个蓝牙适配器在两个广告数据之间切换,最佳的广告切换间隔是多少,以及要立即被 iOS 识别而没有太多延迟的广告间隔是多少? (我想在 iBeacon 和 GATT 服务广告之间切换)。现
直观上,这两个间隔代表相同的时间量。但区别在于夏令时的变化,在这种情况下,“1 天”在 Spring 可能表示“23 小时”,在秋季可能表示“25 小时”。 我用 PostgreSQL 进行了测试,这
我需要在 Oracle 数据库中生成一个值列表,其中包含以下列数据: ITEM_TYPE VARCHAR2(20) ITEM_LAST_UPDATED DATE ITE
我遇到了一种合并重叠间隔的方法。它有一个部分我不明白: Collections.sort(intervals, new Comparator() { @Override public
我正在尝试从 Analytics Vidhya 做贷款预测的机器学习练习题。当我使用随机森林分类器时,它显示: TypeError:float() argument must be a string
我想为数据帧中的每一行分配一个间隔,这样所有行就不会重叠并覆盖整个可能的范围。因此,我可以根据给定间隔内的值过滤行。 我使用过 pd.Interval,但是当我尝试“正常”过滤时它不起作用: df =
在 Joda-Time 中, Interval.contains(Interval) 的实现看起来像这样: return (thisStart <= otherStart && otherStart
我有一个使用 AngularJS 间隔功能连续运行的毫秒时间。我创建了一个暂停 和继续 按钮。当点击 Pause 按钮时,它将触发 AngularJS 的 Interval.cancel 功能,如果我
我在训练 LR 模型时使用 sklearn2pmml.preprocessing.CutTransformer 和 sklearn.preprocessing.LabelEncoder 对目标进行编码
我想用 interval = alt.selection_interval(encodings=['x']) 在只有一个图表上缩放/调整大小到我选择的间隔(从 mousedown 到 mouseup)
我正在使用kafka 0.10.1.1,并与以下3个属性混淆。 heartbeat.interval.ms session.timeout.ms max.poll.interval.ms heartb
我正在尝试保留数据库标志 30dexpf = 1 直到项目的到期日期等于或介于接下来的 7 天和 30 天之间这是我的数据库表 30dexpf | expiry --------|-------- 0
我正在 Informix 中执行以下操作以删除超过 20 秒的行。 delete from sometable where someDateColumn < (current - interval (
我在 Controller 中有一个基于 setInterval 的函数。我注意到,在第一次调用它之后,它工作得很好,但即使在路线改变后它仍然继续。之后我尝试使用 native $interval 服
我正在尝试创建一个按钮,单击该按钮将启动计时器,第二次单击将停止计时器,并将“按钮”的innerHtml更改为您停止计时器的时间。然而,它不适用于我在下面编写的代码,间隔只是继续进行,似乎每次点击都会
我是编程新手,最近一直在研究 AngularJS。 为了练习,我决定尝试制作一个简单的秒表。 从初始“时间”值 0 开始,我使用 $interval 将“时间”每 10 毫秒递增 0.01。我可以毫无
我正在尝试将间隔*[a,b]*除以保存在浮点变量数组中的*npt*点。 我需要 *a* 和 *b* 始终出现在最终数组中,并且 *npt* 可以根据我的需要进行变化。 我尝试过: delta = (b
我是一名优秀的程序员,十分优秀!