Skip to content

forde oob cvg count fix#57

Open
jkapar wants to merge 1 commit intomainfrom
forde_oob_leaf_weights
Open

forde oob cvg count fix#57
jkapar wants to merge 1 commit intomainfrom
forde_oob_leaf_weights

Conversation

@jkapar
Copy link
Collaborator

@jkapar jkapar commented Jan 13, 2026

Coverages did not sum to num_trees when oob = T or oob = "inbag" was used. Fix with this PR.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where coverage values did not sum to num_trees when using out-of-bag (OOB) or in-bag sampling options in the forde function. The fix adds normalization to ensure coverage values sum to 1.0 per tree.

Changes:

  • Added normalization step for coverage calculation in OOB and in-bag modes
  • Added comprehensive test to verify coverage values sum correctly across all three modes (default, OOB, in-bag)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
R/forde.R Added normalization cvg := cvg/sum(cvg), by = tree for both OOB (line 246) and in-bag (line 255) modes to ensure coverage values sum to 1.0 per tree
tests/testthat/test-return_types.R Added test case verifying that coverage values sum to num_trees across all three sampling modes (default, OOB, in-bag)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant