Closed ghost closed 8 years ago
This is set automatically in mlr, so just omit the num_class
part:
lrn = makeLearner("classif.xgboost", predict.type = "prob",
par.vals = list(objective = "multi:softprob"))
See line 69 in https://github.com/mlr-org/mlr/blob/master/R/RLearner_classif_xgboost.R.
Hi,
Rather than changing configureMlr, would like to understand what the problem is and locate the "description object" that the error message refers to, but can't find it.
Just for clarification about the error message and the description object:
As you probably know every learner has a parameter set (accessible by getParamSet
, see below) that contains descriptions of all parameters you might want to set or tune. If you are trying to set a parameter which is not registered in the parameter set you get the error message about the missing description object.
In your case it is missing for good reason, as explained by Philipp.
If it's missing by mistake you can turn this check off via configureMlr
or the config
argument of makeLearner
(see also http://mlr-org.github.io/mlr-tutorial/release/html/configureMlr/index.html#example-turning-off-parameter-checking).
lrn = makeLearner("classif.xgboost", predict.type = "prob",
+ par.vals = list(objective = "multi:softprob"))
getParamSet(lrn)
Type len Def Constr Req Tunable Trafo
booster discrete - gbtree gbtree,gblinear - TRUE -
silent integer - 0 -Inf to Inf - TRUE -
eta numeric - 0.3 0 to Inf - TRUE -
gamma numeric - 0 0 to Inf - TRUE -
max_depth integer - 6 0 to Inf - TRUE -
min_child_weight numeric - 1 0 to Inf - TRUE -
subsample numeric - 1 0 to 1 - TRUE -
...
I have updated the note of classif.xgboost to make this (even) clearer
note = "All settings are passed directly, rather than through xgboost
's params
argument. nrounds
has been set to 1
by default. num_class
is set internally, so do not set this manually."
closing.
I would like to apply xgboost on a classification problem with 3 classes:
This gives an error:
Rather than changing configureMlr, would like to understand what the problem is and locate the "description object" that the error message refers to, but can't find it.
sessionInfo: