Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

superType bug #68

Closed
bgreenwell opened this issue Apr 6, 2018 · 0 comments
Closed

superType bug #68

bgreenwell opened this issue Apr 6, 2018 · 0 comments
Labels

Comments

@bgreenwell
Copy link
Owner

From stackoverflow:

# 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 plot

  pd <- partial(bst$handle,
            pred.var = c("x.1"), 
            grid.resolution = 10, 
            train = data.matrix(subset(trn, select = -y)),
            prob=TRUE,
            plot = FALSE,
            .progress = "text")

 Warning message:
 In superType.default(object) :
 `type` could not be determined; 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].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant