-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fixes for some issues #183
base: main
Are you sure you want to change the base?
Conversation
R/convertDiscrete.R
Outdated
@@ -65,6 +65,6 @@ discreteValueToName = function(par, x) { | |||
if (par$type == "discrete") { | |||
ns[getIndex(par$values, x)] | |||
} else if (par$type == "discretevector") { | |||
sapply(x, function(x) ns[getIndex(x, values = par$values)]) | |||
vcapply(x, function(app x) ns[getIndex(x, values = par$values)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nice thing about sapply
is that it gives list()
in case of length(x) == 0
, which would match quite nicely with the actual default being list()
. When the related BBmisc issue gets fixed, this will result in the most natural printout. vcapply
will give character(0)
when x
is list()
, which is a deviation from the behaviour of the other "vector" types (which always show logical(0)
, numeric(0)
etc. depending on their type).
Not going to say much about the syntax error here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the typo. But in the documentation we say that the output is a character vector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I didn't consider the other points from which discreteValueToName
gets called. I'd still say the printout of a discreteVectorLearnerParam
with default list()
shouldn't have character(0)
in it.
Because this thread is invisible let's continue it here:
I agree in this point. You mentioned it here but the conversion to |
> makeDiscreteVectorLearnerParam("x", NA, values=c("a", "b", "c"), default = list())
Type len Def Constr Req Tunable Trafo
1 discretevector NA list() a,b,c - TRUE -
Used: train. looks nice. |
Fixes for: #180 #181 #182