sl3 icon indicating copy to clipboard operation
sl3 copied to clipboard

Earth offset

Open blind-contours opened this issue 3 years ago • 4 comments

Earth was not incorporating the offset when making predictions originally due to offset issues with do.call and glm predict. Here, I simply make earth create a formula which can include an offset to fix this problem.

blind-contours avatar Feb 09 '22 01:02 blind-contours

Please avoid using formulas unless specified by the end user. The formula interface in R is inefficient, and so shouldn't be used for internal operations. Happy to help resolve the offset issue without appealing to the formula interface.

jeremyrcoyle avatar Feb 09 '22 01:02 jeremyrcoyle

That would be great. I could use some help getting the offset working without using the formula. I don't know of another solution besides just adding the offset into the predictions. Thanks.

blind-contours avatar Feb 09 '22 15:02 blind-contours

Just following up on this so we can get it merged and fixed. @jeremyrcoyle would the solution to avoid formula be to add the offset to the predictions?

rachaelvp avatar Apr 05 '22 23:04 rachaelvp

Sorry I haven't had time to check in on this one. Just debug() the function that takes the formula, find out what function it calls with what argument to specify the offsets. Your suggestion is also good, you'd have to implement the link function and offsets yourself by changing the prediction type fed to the underlying learner, which is maybe something we should consider doing across the board. That would allow us to say we're in a glm framework which could be cool

jeremyrcoyle avatar Apr 06 '22 02:04 jeremyrcoyle