get_training_data.default problems
lawremi opened this issue · 2 comments
The partial()
function fails on ranger objects unless the data=
argument is explicitly named in the call. get_training_data.default()
could use match.call()
to figure out the names when they are not specified. Also, it calls eval()
without an environment argument. The calling environment should be passed down the stack so that the evaluation happens in the right frame, although even that is not fool-proof. Why is there a check for S4 objects? There could be a getCall()
method for an S4 class just as easily as for an S3 class.
Good catch! This is not specific to ranger either. Honestly this function was only meant to be helpful in very general cases as it's always better to specify the training data via the train
argument in the call to pdp::partial()
. I'll try to push a fix relatively soon.
Improved functionality in dev version.