You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an issue I can't quite narrow down. It seems that ranger fails when all three of these are fulfilled: (1) there are unique case.weights, (2) quantreg = TRUE, and keep.inbag = TRUE:
>mtcars$cyl[1] =99>ranger::ranger(mpg~., mtcars, case.weights=mtcars$cyl, quantreg=TRUE, keep.inbag=TRUE)
# Error in ranger::ranger(mpg ~ ., mtcars, case.weights = mtcars$cyl, quantreg = TRUE, : # Error: Too few trees for out-of-bag quantile regression.
It runs with mtcars$cyl[1:2] = 99.
However, ranger has no problems with unique case.weights here:
That's expected behavior. The case.weights control the sampling of observations for the trees. If you set mtcars$cyl[1] = 99 and use that as case weights, observations 1 is selected in every tree and never out-of-bag. Thus, we cannot do out-of-bag quantile regression for that observation.
However, thinking about that, shouldn't we make this a warning instead of an error and just assign NA to the affected observations?
Ah, I see. Yes, a warning + NA would be great! I guess I'll just need to do some pmin()/pmax() or scale() on the weights to restrict them to a narrower range. And raise num.tress to increase the probability that some trees include low-weight cases.
BTW, I just installed the dev version and I'm blown away by the speed improvements for quantile regression!
Here's an issue I can't quite narrow down. It seems that
ranger
fails when all three of these are fulfilled: (1) there are uniquecase.weights
, (2)quantreg = TRUE
, andkeep.inbag = TRUE
:It runs with
mtcars$cyl[1:2] = 99
.However,
ranger
has no problems with uniquecase.weights
here:I'm experiencing the former error in a number of analyses I'm currently running. Thanks for an awesome package!
The text was updated successfully, but these errors were encountered: