Pass objective as passible engine argument for rule_fit()#96
Merged
EmilHvitfeldt merged 4 commits intomainfrom Jan 26, 2026
Merged
Pass objective as passible engine argument for rule_fit()#96EmilHvitfeldt merged 4 commits intomainfrom
EmilHvitfeldt merged 4 commits intomainfrom
Conversation
EmilHvitfeldt
approved these changes
Jan 15, 2026
Comment on lines
-29
to
-37
| # use 4.0 or 4.1 to check with rtools40's older compiler | ||
| - {os: windows-latest, r: 'oldrel-4'} | ||
|
|
||
| - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | ||
| - {os: ubuntu-latest, r: 'release'} | ||
| - {os: ubuntu-latest, r: 'oldrel-1'} | ||
| - {os: ubuntu-latest, r: 'oldrel-2'} | ||
| - {os: ubuntu-latest, r: 'oldrel-3'} | ||
| - {os: ubuntu-latest, r: 'oldrel-4'} |
Member
There was a problem hiding this comment.
if these are related to the GHAs failing on older versions, I would use this trick instead: https://github.com/tidymodels/parsnip/pull/1317/files#diff-9c940e8ad2b7bc4c26ec3da57b94bc00e73e2166cfed689da51a4c59bcc0a310L59-L61
| @@ -1,3 +1,20 @@ | |||
| penalties <- 10^(-5:-1) | |||
Member
There was a problem hiding this comment.
This appears not to be used anywhere
| obs_pred <- rf_m_prob |> dplyr::filter(penalty == i) | ||
| for (i in 1:ncol(rf_prob)) { | ||
| expect_equal(obs_pred[[i]], unname(exp_pred[, i])) | ||
| expect_equal(obs_pred[[i]], unname(exp_pred[, i]), tolerance = 0.4) |
Member
There was a problem hiding this comment.
that is quite the tolerance!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #95
There are still issues that make it continue to be difficult to make the xrf and rules fits the same.
One other issue is that tidymodels uses a one-hot encoding when creating dummy variables for xgboost while xrf uses the standard full-rank encoding produced by
model.matrix().This PR solves the objective issue and updates some tests for the new xgboost API. The probability-based tests now use a tolerance since their results are very similar. I've removed or commented out tests based on hard class predictions, as we have no way of ensuring that those will be equal (but plan to resolve this discrepancy).