gravesee / rulefit

Fit Lasso model to binary rules created from tree ensembles
10 stars 1 forks source link

Support gbm3. #1

Closed Weekend-Warrior closed 7 years ago

Weekend-Warrior commented 7 years ago

Support is needed for gbm3 which changed the schema for the S3 output.

gravesee commented 7 years ago

gbm3 has a conversion function to shoehorn the new objects back into the old versions. The function has a small bug, though. I have a pull request for gbm3 here:

https://github.com/gbm-developers/gbm3/pull/147

You can build with this branch if necessary as they might not merge it.

https://github.com/Zelazny7/gbm3/tree/fix-convert

The other fix is to convert the object using the currently broken convert functionand then overwrite the distribution element like so:

old_modf <- gbm3::to_old_gbm(mod) old_mod$distribution <- list(name=old_mod$distribution)

We can keep this open, though, as I'd like to make the rulefit constructor dispatch based on the type of object that is passed.

gravesee commented 7 years ago

Just patched it here. Now it checks if the conversion is in the right format.

427eeddd8d080e1bee6da43e14e696a5c6bdeed5 <- added GBMFit generic but had a typo d47bf8f6a59531411b9c6d8b078ebc5b3b06eb1c <- fixed typo