Skip to content

Add return_members option to CommitteeRegressor.predict()#532

Open
hmacdope wants to merge 2 commits into
mainfrom
feat/ensemble-return-members
Open

Add return_members option to CommitteeRegressor.predict()#532
hmacdope wants to merge 2 commits into
mainfrom
feat/ensemble-return-members

Conversation

@hmacdope
Copy link
Copy Markdown
Contributor

Closes #464

Summary

  • Adds return_members=False to CommitteeRegressor.predict() and _predict()
  • When True, the raw per-member predictions are appended to the return tuple with shape (n_samples, n_tasks, n_members)
  • Composes with return_std — all four combinations are supported:
    • predict(X)mean
    • predict(X, return_std=True)(mean, std)
    • predict(X, return_members=True)(mean, members)
    • predict(X, return_std=True, return_members=True)(mean, std, members)
  • No changes to existing call sites — fully backwards compatible

Test plan

  • test_return_members unit test covers shape, consistency with mean/std, and the no-flag scalar return

🤖 Generated with Claude Code

hmacdope and others added 2 commits April 20, 2026 12:41
Adds return_members=False to _predict() and predict(). When True,
the raw per-member predictions are returned as the last element of
the tuple with shape (n_samples, n_tasks, n_members). Composes
cleanly with return_std: callers can request any combination of
mean, std, and member predictions.

Closes #464

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hmacdope hmacdope requested a review from smcolby April 23, 2026 23:37
@hmacdope
Copy link
Copy Markdown
Contributor Author

@smcolby can you review here?

Copy link
Copy Markdown
Contributor

@smcolby smcolby left a comment

Choose a reason for hiding this comment

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

A bit of pedantry: return_members gives the impression that we'd be returning the members themselves. What do you thinking about return_all?

Second, when returning the full set of predictions, do we want to return only the (n_samples, n_tasks, n_members)-shaped array, and not the mean and std? I.e. one would assume a user would be using the full array downstream, so mean and std calcs would be handled as needed. Of course this would require some argument validation to make return_std and return_all (or whatever we decide) mutually exclusive.

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.

[ENH] When predicting with an ensemble there should be an option to return the predictions of each ensemble member

3 participants