傳統GBM,我們可以使用 predict.gbm(模型,newsdata = ...,n.tree = ...)的樹木h2o.gbm數
這樣我可以比較不同的結果測試數據的樹數。
在h2o.gbm中,雖然它有n.tree來設置,但它似乎對結果沒有任何影響。這與默認模式完全相同:
h2o.test.pred <- as.vector(h2o.predict(h2o.gbm.model, newdata=test.frame, n.tree=100))
R2(h2o.test.pred, test.mat$y)
[1] -0.00714109
h2o.test.pred <- as.vector(h2o.predict(h2o.gbm.model, newdata=test.frame, n.tree=10))
> R2(h2o.test.pred, test.mat$y)
[1] -0.00714109
是否有任何問題?如何解決它? h2o.gbm比gbm快得多,所以如果它能得到每棵樹的詳細結果,那將是很棒的。
預測您僅在'h2o.gbm.model'中使用該模型n.tree未使用https://www.rdocumentation.org/packages/ h2o/versions/2.8.1.1/topics/h2o.predict –
@ s.brunel 2.8.1.1很舊。最新文檔:http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/gbm.html –