需要了解xgboost中使用的方法,来计算xgboost预测函数中分类问题的概率。
发布于 2018-08-14 14:27:20
这是二进制分类的sketch-Code:
library(xgboost)
data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
train <- agaricus.train
test <- agaricus.test
bst <- xgboost(data = train$data, label = train$label, max.depth = 2, eta = 1, nthread = 2, nround = 2, objective = "binary:logistic")
pred <- predict(bst, test$data)
print(head(pred))
https://stackoverflow.com/questions/-100002133
复制相似问题