- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 Datacamp Extreme Gradient Boosting with XGBoost 上进行教程,但我对一个结果有些困惑。
执行以下代码时
# Create your housing DMatrix:
housing_dmatrix = xgb.DMatrix(data=data, label=y)
# Create the parameter dictionary for each tree: params
params = {"objective":"reg:linear", "max_depth":4}
# Perform cross-validation with early stopping: cv_results
cv_results = xgb.cv(dtrain=housing_dmatrix,params=params,nfold=3, num_boost_round=50, early_stopping_rounds=10, metrics="rmse", as_pandas=True, seed=123)
# Print cv_results
print(cv_results)
mean_mae = cv_results['test-rmse-mean'].min()
boost_rounds = cv_results['test-rmse-mean'].idxmin()
print("\tRMSE {} for {} rounds".format(mean_mae, boost_rounds))
test-rmse-mean test-rmse-std train-rmse-mean train-rmse-std
0 142644.104167 705.732300 141861.109375 396.179855
1 104867.638021 109.049658 103035.130209 47.104957
2 79261.453125 573.946485 75944.486979 264.292182
3 61684.972656 1010.777141 57339.683594 525.791040
4 50591.589844 1796.898432 44487.089844 597.177883
5 43296.019531 1826.395300 35787.472656 722.298168
6 38898.184896 1751.704546 29919.669922 691.136345
7 36395.877604 1678.547627 26036.014974 643.247157
8 34805.308594 1738.570391 23456.447266 735.406007
9 33709.807292 1476.484849 21628.860677 744.936771
10 33272.565104 1321.658776 20267.642578 720.847179
11 32559.872396 1067.106826 19335.697917 583.088133
12 32151.852865 988.789741 18699.406901 577.292625
13 32147.481120 727.223369 18167.764974 552.016786
14 31866.852865 816.375161 17630.004557 540.065450
15 31786.338542 719.051429 17277.742187 521.709410
16 31541.460287 747.203840 16895.608724 416.004588
17 31397.618490 754.207664 16581.137370 410.450468
18 31445.539714 822.826225 16352.770508 469.756961
19 31452.218099 876.353819 16117.928060 450.584992
20 31385.645182 829.827774 15862.508464 384.789582
21 31296.314453 881.374220 15542.022461 410.365996
22 31290.126953 875.634123 15261.000325 382.412151
23 31252.852865 782.195943 15008.689128 490.904289
24 31210.020182 753.773505 14853.276042 531.599930
RMSE 31210.020182333334 for 24 rounds
test-rmse-mean test-rmse-std train-rmse-mean train-rmse-std
0 142644.104167 705.732300 141861.109375 396.179855
1 104867.638021 109.049658 103035.130209 47.104957
2 79261.453125 573.946485 75944.486979 264.292182
3 61684.972656 1010.777141 57339.683594 525.791040
4 50591.589844 1796.898432 44487.089844 597.177883
5 43296.019531 1826.395300 35787.472656 722.298168
6 38898.184896 1751.704546 29919.669922 691.136345
7 36395.877604 1678.547627 26036.014974 643.247157
8 34805.308594 1738.570391 23456.447266 735.406007
9 33709.807292 1476.484849 21628.860677 744.936771
10 33272.565104 1321.658776 20267.642578 720.847179
11 32559.872396 1067.106826 19335.697917 583.088133
12 32151.852865 988.789741 18699.406901 577.292625
13 32147.481120 727.223369 18167.764974 552.016786
14 31866.852865 816.375161 17630.004557 540.065450
15 31786.338542 719.051429 17277.742187 521.709410
16 31541.460287 747.203840 16895.608724 416.004588
17 31397.618490 754.207664 16581.137370 410.450468
18 31445.539714 822.826225 16352.770508 469.756961
19 31452.218099 876.353819 16117.928060 450.584992
20 31385.645182 829.827774 15862.508464 384.789582
21 31296.314453 881.374220 15542.022461 410.365996
22 31290.126953 875.634123 15261.000325 382.412151
23 31252.852865 782.195943 15008.689128 490.904289
24 31210.020182 753.773505 14853.276042 531.599930
25 31351.985677 675.589696 14622.553711 484.633075
26 31355.926432 698.751442 14430.575195 619.787710
27 31389.998698 648.971218 14204.662760 568.655261
28 31356.138021 711.192347 14013.201498 546.941784
29 31292.576172 697.337663 13823.481445 581.756303
30 31306.197266 751.915534 13579.544271 599.841587
31 31285.968099 724.867998 13361.774739 631.805694
32 31299.003255 684.342196 13251.625325 674.017166
33 31287.397786 720.993414 13034.457031 749.805941
34 31249.546224 705.225396 12844.346354 691.202512
35 31203.748698 733.094000 12618.286133 624.664883
36 31173.789063 733.643603 12495.182292 609.643329
37 31172.117839 669.111951 12387.871745 607.720998
38 31170.850912 663.908881 12240.325846 583.204898
39 31162.634765 687.274839 12082.383463 555.608639
40 31142.460287 712.869918 11930.459310 589.554611
41 31160.911459 709.512382 11804.457357 614.642441
42 31175.446615 652.927064 11729.721680 618.773653
43 31166.930339 642.093634 11624.710612 623.662847
44 31135.966797 650.693105 11415.508138 612.949992
45 31155.915365 677.580853 11300.589193 651.227389
46 31158.777344 622.338647 11231.110026 663.325455
47 31161.392578 646.070369 11111.234049 679.541984
48 31153.126302 623.746479 11038.423828 677.875949
49 31137.419922 628.337573 10952.264323 653.939810
RMSE 31135.966797 for 44 rounds
最佳答案
rmse
作为您的指标,但未设置 maximize = TRUE
,XGBoost 将返回分配的轮次中具有最低 RMSE 的轮次。 early_stopping_rounds = n
, XGBoost 将在到达 num_boost_round
之前停止如果它走了n
在没有改进度量的情况下进行轮次。 关于python-3.x - 如何在 XGBooost 中使用 early_stopping_rounds 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47854217/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!