-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Error when default argument is passed to par.vals in learner xgboost #1191
Comments
Does that answer your question? |
this can now be solved, very fortunately !, with @jakob-r 's new special.vals option in PH. thx for detecting this. |
it does not really answer the question. we define a default value. then this is not settable, pro-actively, by mlr. ergo: this is stupid, and @philippstats has detected a real problem. the problem is, that sometimes some param allow certain values, that dont "fit" into the formal param type of PH. very often, but not always, these are also the default values. examples: |
Why would you ever want to set these special values? |
i dont get what you mean. because they are valid settings of a parameter? and you want to control that param from mlr? and not have mlr forbid you to set these values? |
At least in this example it's not a valid value. if you set Do you have an example where it would make sense to set a parameter to a value that's not allowed by its definition? |
here is another example: |
i have just posted one (the knn). but for xgboost it is the SAME. NA is a VALID SETTING of the param "missing". you are somehow not getting the point here. xgboost has a param "missing". you can set it to numbers, like 0, or 99. or NA_real. but the latter, mlr forbids, completely arbitrarily. |
Ok, fair enough. The xgboost documentation doesn't say that |
The special values should be documented somewhere. |
well, in this specific example, the xgboost "missing", xgboost really sucks. they also changed this back and forth (i had to consider / fix this in general because somebody reported some problems there.) but they say one should basically select a certain numeric value that encodes "missingness". but in R NA_real is such a numeric entry. so their docs are kinda ok in this regard, now. the real problem is something else! their default value is missing = NULL. this has actually 2 problems. |
where? isnt this documented in PH? or do you mean in the "learner API" in the mlr tutorial appendix? |
In the tutorial. But in particular the special values that are allowed/make sense should be documented. |
My use case was: |
thx. yup i understand that. |
this is fixed now in PR #1225 it looks like this:
|
Then we can close here? |
The default of argument
missing
in xgboost is set to0
in par.set andNA_real_
in par.vals.When I pass the default par.vals to par.vals:
makeLearner("classif.xgboost", par.vals = list(missing = NA_real_))
This error occurs:
Error in setHyperPars2.Learner(learner, insert(par.vals, args)) : NA is not feasible for parameter 'missing'!
It seems like
makeNumericLearnerParam
does not acceptNA_real_
as numeric value.Also not working:
makeLearner("classif.xgboost", par.vals = list(missing = NA))
The text was updated successfully, but these errors were encountered: