Skip to content

Support __len__ in ensemble estimators#6468

Merged
rapids-bot[bot] merged 1 commit intorapidsai:branch-25.04from
jcrist:support-rf-length
Mar 19, 2025
Merged

Support __len__ in ensemble estimators#6468
rapids-bot[bot] merged 1 commit intorapidsai:branch-25.04from
jcrist:support-rf-length

Conversation

@jcrist
Copy link
Copy Markdown
Member

@jcrist jcrist commented Mar 19, 2025

sklearn ensemble estimators are valid sequences of estimators. Supporting __getitem__ and __iter__ is hard with our current implementation, but __len__ is easy and lets more of the sklearn compatiblity tests pass.

Fixes #6465.

`sklearn` ensemble estimators are valid sequences of estimators.
Supporting `__getitem__` and `__iter__` is _hard_ with our current
implementation, but `__len__` is easy and lets more of the sklearn
compatiblity tests pass.
@jcrist jcrist requested a review from a team as a code owner March 19, 2025 20:26
@jcrist jcrist requested review from teju85 and vyasr March 19, 2025 20:26
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Mar 19, 2025
@jcrist jcrist added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 19, 2025
Copy link
Copy Markdown
Contributor

@csadorf csadorf left a comment

Choose a reason for hiding this comment

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

LGTM!

@jcrist
Copy link
Copy Markdown
Member Author

jcrist commented Mar 19, 2025

/merge

@rapids-bot rapids-bot Bot merged commit a34755a into rapidsai:branch-25.04 Mar 19, 2025
@jcrist jcrist deleted the support-rf-length branch March 19, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Missing __len__ method in RandomForestClassifier

2 participants