Conversation
R/convertDiscrete.R
Outdated
| 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.
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.
Sorry about the typo. But in the documentation we say that the output is a character vector.
There was a problem hiding this comment.
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