You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Load required packages
library(pdp)
library(xgboost)
# Simulate training data with ten million records
set.seed(101)
trn<- as.data.frame(mlbench::mlbench.friedman1(n=1e+07, sd=1))
trn=trn[sample(nrow(trn), 500), ]
trn$y=ifelse(trn$y>16,1,0)
# Fit an XGBoost classification(logistic) model
set.seed(102)
bst<- xgboost(data= data.matrix(subset(trn, select=-y)),
label=trn$y,
objective="reg:logistic",
nrounds=100,
max_depth=2,
eta=0.1)
#partial dependency plotpd<- partial(bst$handle,
pred.var= c("x.1"),
grid.resolution=10,
train= data.matrix(subset(trn, select=-y)),
prob=TRUE,
plot=FALSE,
.progress="text")
Warningmessage:In superType.default(object) :`type`couldnotbedetermined; assuming`type = "regression"`
This should issue an error, not a waring!? Also, XGBoost support will need to be amended to correctly handle objective = "reg:logistic", which seems to provide continuous predictions in [0, 1].
The text was updated successfully, but these errors were encountered:
From stackoverflow:
This should issue an error, not a waring!? Also, XGBoost support will need to be amended to correctly handle
objective = "reg:logistic"
, which seems to provide continuous predictions in [0, 1].The text was updated successfully, but these errors were encountered: