Skip to content

Deprecate max_depth=16 in RandomForest and add None support - #7958

Merged
rapids-bot[bot] merged 35 commits into
NVIDIA:mainfrom
Nzouh:feature/max-depth-deprecate
Apr 28, 2026
Merged

Deprecate max_depth=16 in RandomForest and add None support#7958
rapids-bot[bot] merged 35 commits into
NVIDIA:mainfrom
Nzouh:feature/max-depth-deprecate

Conversation

@Nzouh

@Nzouh Nzouh commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR implements the deprecation of the max_depth=16 default in cuML Random Forest estimators (Single-GPU and Dask) to align with scikit-learn's unlimited depth policy, fulfilling issue #7945.

Changes

  • FutureWarning: Now emitted when using the default max_depth=16; default will change to None in 26.08.
  • Support for None: Added max_depth=None (unlimited depth), mapped to INT_MAX for the C++ backend.
  • Strict Validation: Added checks to ensure max_depth is a positive integer or None.
  • Global Test Filters: Added pytestmark filters with TODO(26.08) to suppress warnings in existing tests for CI stability.
  • Docs & Changelog: Updated all 4 estimator docstrings and added a release notice to CHANGELOG.md.

Verification

Logic verified via custom tests for default behavior, None mapping, and value validation. Test suite updated to handle new warnings.
Closes #7945

@copy-pr-bot

copy-pr-bot Bot commented Apr 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Nzouh
Nzouh requested review from a team as code owners April 8, 2026 04:45
@Nzouh
Nzouh requested review from Copilot, jcrist and msarahan April 8, 2026 04:45
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Apr 8, 2026
@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a sentinel default for RandomForest max_depth, warns when callers rely on the old implicit default, maps the sentinel to 16 at runtime (including Dask worker model creation), updates docstrings to note the upcoming default change, and suppresses the new warning across many tests.

Changes

Cohort / File(s) Summary
Core CPU RandomForest Implementation
python/cuml/cuml/ensemble/randomforest_common.pyx
Introduce _DEPRECATED_MAX_DEPTH_DEFAULT sentinel; change BaseRandomForestModel.__init__ default to sentinel; emit FutureWarning and map sentinel → 16 at fit time; validate using the mapped local max_depth.
Dask RandomForest Implementation
python/cuml/cuml/dask/ensemble/base.py
When creating per-worker models, detect missing max_depth, emit FutureWarning, and inject kwargs["max_depth"]=16 before client.submit(...) so workers see the old default.
CPU Documentation
python/cuml/cuml/ensemble/randomforestclassifier.py, python/cuml/cuml/ensemble/randomforestregressor.py
Add .. versionchanged:: 26.08 notes to max_depth parameter docs indicating the default will change from 16None.
Tests — warning suppression & small updates
python/cuml/tests/... (e.g. tests/test_api.py, tests/test_base.py, tests/test_common.py, tests/test_fil.py, tests/test_meta_estimators.py, tests/test_pickle.py, tests/explainer/*, tests/test_random_forest.py, tests/dask/test_dask_random_forest.py, tests/test_sklearn_compatibility.py)
Add module-level pytestmark or per-test filterwarnings to ignore the new FutureWarning about max_depth; update SPDX years; adjust tests to assert/suppress the warning and set or remove explicit max_depth values where appropriate.
Tests — small formatting/constructor tweaks
python/cuml/tests/dask/test_dask_random_forest.py, python/cuml/tests/test_random_forest.py, python/cuml/tests/test_sklearn_compatibility.py
Minor test formatting and constructor argument changes; replace some hardcoded max_depth=16 uses or set sklearn baselines to max_depth=None for compatibility.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related issues

  • Issue #7946: Continues the max_depth default migration work; this PR implements the sentinel, warning, and Dask propagation behavior that aligns with that issue's objectives.

Possibly related PRs

  • PR #7895: Implements max_depth=None support for RandomForest; this PR builds on that support by deprecating the old default and updating propagation/docs.

Suggested reviewers

  • jcrist
  • hcho3
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Deprecate max_depth=16 in RandomForest and add None support' clearly and specifically summarizes the main changes in the pull request.
Linked Issues check ✅ Passed All objectives from issue #7945 are met: FutureWarning added for implicit defaults [#7945], max_depth=None support implemented [#7945], validation enforced [#7945], documentation updated [#7945], and release notes added [#7945].
Out of Scope Changes check ✅ Passed All changes are in-scope: core deprecation logic, max_depth=None support, validation, documentation updates, test updates to handle warnings, and SPDX year updates are directly tied to the deprecation effort.
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing the deprecation of max_depth=16 default, FutureWarning implementation, None support, validation, test filters, and documentation updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
python/cuml/cuml/ensemble/randomforest_common.pyx (1)

438-439: Training-time validation appears redundant after constructor validation.

After __init__, self.max_depth is guaranteed to be either a positive integer or -1 (since None is mapped to -1 at line 342-343, and the validation at line 330-331 rejects non-positive values except None).

This check self.max_depth <= 0 and self.max_depth != -1 can only be true if max_depth is 0 or a negative number other than -1, but such values are already rejected in __init__. Consider removing this redundant check or clarifying the intent.

♻️ Consider simplifying or removing

If this is defensive coding for cases where max_depth might be modified after construction:

-        if self.max_depth <= 0 and self.max_depth != -1:
-            raise ValueError("Must specify max_depth > 0 or None")
+        if self.max_depth <= 0 and self.max_depth != -1:
+            raise ValueError("max_depth must be > 0 or -1 (unlimited)")

Or remove entirely if truly unreachable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@python/cuml/cuml/ensemble/randomforest_common.pyx` around lines 438 - 439,
The runtime check "if self.max_depth <= 0 and self.max_depth != -1: raise
ValueError(...)" in randomforest_common.pyx is redundant given the constructor
(__init__) already maps None->-1 and validates max_depth; remove this check from
the training path (e.g., in the fit/training method where it appears) or replace
it with a short defensive assertion/comment indicating it should be unreachable.
Update or remove the validation in the training code that references
self.max_depth so only the constructor (__init__) enforces the invariant (or
keep a one-line assert like "assert self.max_depth > 0 or self.max_depth == -1"
with an explanatory comment).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@python/cuml/cuml/dask/ensemble/base.py`:
- Around line 49-55: The warning currently fires even when a caller explicitly
passes max_depth=16 because the code checks kwargs.get('max_depth', 16) == 16;
change this to only warn when max_depth was not provided (e.g. if 'max_depth'
not in kwargs or kwargs.get('max_depth', None) is None) so explicit max_depth=16
does not trigger it, and add stacklevel=2 to the warnings.warn call to point the
warning at the caller; update the block around the existing condition in base.py
where the default max_depth warning is emitted to use the new presence check and
include stacklevel=2 in the warnings.warn invocation.

In `@python/cuml/cuml/ensemble/randomforest_common.pyx`:
- Around line 333-339: The warning is emitted whenever max_depth == 16,
including when a user explicitly passes max_depth=16; change the logic so the
warning only fires when the caller relied on the default (i.e., max_depth was
not provided). Implement this by using a sentinel default (e.g.,
max_depth=_DEFAULT_MAX_DEPTH or a private sentinel like _MAX_DEPTH_NOT_SET) or
by adding an explicit flag parameter (e.g., max_depth_provided) set in the
constructor call site, then check for the sentinel/not-provided state before
issuing the warning; also add stacklevel=2 to the warnings.warn call so the
warning points at the user's call site. Ensure you update the function/class
signature where max_depth is declared and adjust all internal callers to pass
the sentinel or the provided flag accordingly, and keep the warning message and
FutureWarning type unchanged.

---

Nitpick comments:
In `@python/cuml/cuml/ensemble/randomforest_common.pyx`:
- Around line 438-439: The runtime check "if self.max_depth <= 0 and
self.max_depth != -1: raise ValueError(...)" in randomforest_common.pyx is
redundant given the constructor (__init__) already maps None->-1 and validates
max_depth; remove this check from the training path (e.g., in the fit/training
method where it appears) or replace it with a short defensive assertion/comment
indicating it should be unreachable. Update or remove the validation in the
training code that references self.max_depth so only the constructor (__init__)
enforces the invariant (or keep a one-line assert like "assert self.max_depth >
0 or self.max_depth == -1" with an explanatory comment).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 19eb66ae-31b7-4bca-b076-f22489182ad9

📥 Commits

Reviewing files that changed from the base of the PR and between 45e05ef and 355eaf8.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • python/cuml/cuml/dask/ensemble/base.py
  • python/cuml/cuml/dask/ensemble/randomforestclassifier.py
  • python/cuml/cuml/dask/ensemble/randomforestregressor.py
  • python/cuml/cuml/ensemble/randomforest_common.pyx
  • python/cuml/cuml/ensemble/randomforestclassifier.py
  • python/cuml/cuml/ensemble/randomforestregressor.py

Comment thread python/cuml/cuml/dask/ensemble/base.py Outdated
Comment thread python/cuml/cuml/ensemble/randomforest_common.pyx Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a deprecation path for cuML RandomForest’s current default max_depth=16 and adds support for max_depth=None (mapped internally to -1) across single-GPU and Dask RandomForest estimators, along with doc/release-note updates.

Changes:

  • Emit a FutureWarning related to the upcoming default change from max_depth=16 to None (unlimited depth).
  • Add max_depth=None support by mapping None -> -1 for the backend and tighten max_depth validation.
  • Update docstrings for RandomForest classes and add a changelog entry.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
python/cuml/cuml/ensemble/randomforest_common.pyx Adds max_depth validation, emits FutureWarning, and maps None to -1.
python/cuml/cuml/ensemble/randomforestclassifier.py Updates max_depth parameter docs for single-GPU classifier.
python/cuml/cuml/ensemble/randomforestregressor.py Updates max_depth parameter docs for single-GPU regressor.
python/cuml/cuml/dask/ensemble/base.py Adds a deprecation FutureWarning in Dask model creation path.
python/cuml/cuml/dask/ensemble/randomforestclassifier.py Updates max_depth parameter docs for Dask classifier.
python/cuml/cuml/dask/ensemble/randomforestregressor.py Updates max_depth parameter docs for Dask regressor.
CHANGELOG.md Adds a breaking-change note about the max_depth default deprecation.
Comments suppressed due to low confidence (1)

python/cuml/cuml/ensemble/randomforest_common.pyx:351

  • Mapping max_depth=None to -1 is fine for the backend, but BaseRandomForestModel._params_to_cpu currently returns {"max_depth": self.max_depth}. With this change, exporting a model configured with None will pass -1 to scikit-learn, which is not a valid max_depth there. Ensure CPU export maps -1 back to None (and similarly treat -1 consistently as 'unlimited' in any public-facing params).
        # Map None to -1 for the backend
        if max_depth is None:
            max_depth = -1


        self.split_criterion = split_criterion
        self.n_estimators = n_estimators
        self.bootstrap = bootstrap
        self.max_samples = max_samples
        self.max_depth = max_depth
        self.max_leaves = max_leaves

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

Comment on lines +329 to +331
# Only allow positive numbers or None
if max_depth is not None and max_depth <= 0:
raise ValueError("max_depth must be > 0 or None")

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

max_depth validation currently rejects -1 (since -1 <= 0), but the docs now state that -1 is supported for unlimited depth and _fit_forest explicitly allows self.max_depth == -1. Align these by allowing -1 here (and update the error message/comment accordingly).

Suggested change
# Only allow positive numbers or None
if max_depth is not None and max_depth <= 0:
raise ValueError("max_depth must be > 0 or None")
# Only allow positive numbers, None, or -1 for unlimited depth
if max_depth is not None and max_depth != -1 and max_depth <= 0:
raise ValueError("max_depth must be > 0, -1, or None")

Copilot uses AI. Check for mistakes.
Comment on lines +333 to +339
if max_depth == 16:
warnings.warn(
"The default value of 'max_depth' will change from 16 to "
"None (unlimited depth) in release 26.08. To suppress this "
"warning, set 'max_depth' explicitly.",
FutureWarning
)

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

The FutureWarning triggers whenever max_depth == 16, including when a caller explicitly sets max_depth=16. That makes the warning text misleading (it claims setting explicitly will suppress it) and will also break cuML's pytest config where FutureWarning is treated as an error. Consider moving this warning to the Python wrapper __init__ where you can warn only when max_depth was not provided, or use a sentinel to distinguish default vs explicit 16; also consider adding an appropriate stacklevel so the warning points at user code.

Copilot uses AI. Check for mistakes.
Comment thread python/cuml/cuml/dask/ensemble/base.py Outdated
Comment thread CHANGELOG.md Outdated
Comment on lines +4 to +5
* Deprecate `max_depth=16` default in `RandomForestClassifier` and
`RandomForestRegressor` (both single-GPU and Dask variants). The default will change to `None` (unlimited depth) in release 26.08

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

Markdown list formatting: the second line of this bullet (RandomForestRegressor...) is not indented, so it won’t be treated as part of the bullet item. Keep the bullet on one line or indent continuation lines so the list renders correctly.

Suggested change
* Deprecate `max_depth=16` default in `RandomForestClassifier` and
`RandomForestRegressor` (both single-GPU and Dask variants). The default will change to `None` (unlimited depth) in release 26.08
* Deprecate `max_depth=16` default in `RandomForestClassifier` and `RandomForestRegressor` (both single-GPU and Dask variants). The default will change to `None` (unlimited depth) in release 26.08

Copilot uses AI. Check for mistakes.
Comment on lines +74 to +76
Maximum tree depth. Must be greater than 0 or -1 (None covers -1).
Unlimited depth (i.e., until leaves are pure) is supported by
providing None or -1.\n

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

Docstring says max_depth supports -1, but the new validation in BaseRandomForestModel.__init__ currently raises for max_depth=-1. Either adjust the implementation to accept -1 (for backward compatibility) or update the docs to advertise only None for unlimited depth.

Suggested change
Maximum tree depth. Must be greater than 0 or -1 (None covers -1).
Unlimited depth (i.e., until leaves are pure) is supported by
providing None or -1.\n
Maximum tree depth. Must be greater than 0, or `None`.
Unlimited depth (i.e., until leaves are pure) is supported by
providing `None`.\n

Copilot uses AI. Check for mistakes.
Comment on lines +69 to +71
Maximum tree depth. Must be greater than 0 or -1 (None covers -1).
Unlimited depth (i.e., until leaves are pure) is supported by
providing None or -1.\n

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

Docstring says max_depth supports -1, but the new validation in BaseRandomForestModel.__init__ currently raises for max_depth=-1. Either adjust the implementation to accept -1 (for backward compatibility) or update the docs to advertise only None for unlimited depth.

Suggested change
Maximum tree depth. Must be greater than 0 or -1 (None covers -1).
Unlimited depth (i.e., until leaves are pure) is supported by
providing None or -1.\n
Maximum tree depth. Must be greater than 0, or ``None`` for
unlimited depth (i.e., until leaves are pure).\n

Copilot uses AI. Check for mistakes.
Comment thread python/cuml/cuml/dask/ensemble/randomforestclassifier.py Outdated
Comment on lines +62 to +64
Maximum tree depth. Must be greater than 0 or -1 (None covers -1).
Unlimited depth (i.e., until leaves are pure) is supported by
providing None or -1.\n

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

Docstring says max_depth supports -1, but the new validation in BaseRandomForestModel.__init__ currently raises for max_depth=-1. Either adjust the implementation to accept -1 (for backward compatibility) or update the docs to advertise only None for unlimited depth.

Suggested change
Maximum tree depth. Must be greater than 0 or -1 (None covers -1).
Unlimited depth (i.e., until leaves are pure) is supported by
providing None or -1.\n
Maximum tree depth. Must be greater than 0, or ``None`` for
unlimited depth.
Unlimited depth (i.e., until leaves are pure) is supported by
providing ``None``.\n

Copilot uses AI. Check for mistakes.
Comment on lines +329 to +332
# Only allow positive numbers or None
if max_depth is not None and max_depth <= 0:
raise ValueError("max_depth must be > 0 or None")

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

The new check only validates the sign of max_depth. Since the public API documents max_depth as int or None, passing a float/NumPy float (e.g. 3.0) will currently make it through __init__ and then fail later when Cython tries to pass it to the C++ backend as an int. Consider validating max_depth is an integer-like type (and raising a clear TypeError/ValueError) close to this check.

Copilot uses AI. Check for mistakes.
Comment thread python/cuml/cuml/dask/ensemble/base.py Outdated
Comment on lines +49 to +55
if kwargs.get('max_depth',16) == 16:
warnings.warn(
"The default value of 'max_depth' will change from 16 to "
"None (unlimited depth) in release 26.08. To suppress this "
"warning, set 'max_depth' explicitly.",
FutureWarning
)

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

With the current implementation, the Dask path can emit the deprecation warning twice: once here on the client, and again on each worker when cuRFC/cuRFR is constructed (since the single-GPU constructors also warn on max_depth==16). This can create very noisy logs and increases the chance of failures in environments treating FutureWarning as errors. Consider emitting this warning in only one place (preferably at the user-facing entrypoint where you can detect default usage).

Copilot uses AI. Check for mistakes.
@chyunsu3 chyunsu3 closed this Apr 8, 2026
@chyunsu3

chyunsu3 commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

We haven't really decided when to introduce deprecation. Closing for now.

cc @csadorf

@Nzouh

Nzouh commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback, @hcho3.

I noticed the docstrings for max_depth=None were recently added to main. Since this PR implements the backend mapping for that feature (mapping None to -1), would you be interested in a revised version that strips out the deprecation warning and only adds the feature support?
As a first-time contributor, I’d love to get this across the finish line if it’s helpful!

@chyunsu3 chyunsu3 reopened this Apr 8, 2026
@chyunsu3

chyunsu3 commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

@Nzouh After internal discussion, we decided to introduce the deprecation of max_depth=16 default in the 26.06 release. Re-opening the pull request now.

TODOs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Line 3: Change the "### 🚨 Breaking Changes" heading in CHANGELOG.md to a
level-2 heading ("## 🚨 Breaking Changes") so the file goes H1 → H2 and
satisfies markdownlint MD001; update the single heading token to "##" to remove
the H1→H3 jump.

In `@python/cuml/cuml/dask/ensemble/base.py`:
- Around line 49-55: The _create_model() path warns when 'max_depth' is missing
but does not add the legacy value to kwargs, causing worker-side model_func(...)
to re-trigger the same FutureWarning; after emitting the warnings.warn call in
_create_model(), set kwargs["max_depth"] = 16 so the legacy value is forwarded
explicitly to worker/model_func and the warning is only shown once.

In `@python/cuml/cuml/ensemble/randomforest_common.pyx`:
- Around line 337-339: Tighten validation for max_depth in the constructor by
rejecting any value that is not None and not a positive integer: change the
current check to verify isinstance(max_depth, numbers.Integral) (or int) and
max_depth > 0, and raise ValueError("max_depth must be > 0 or None") for
anything else; add/import numbers if needed and ensure np.nan, floats like 1.5,
and string values are rejected at __init__ time (reference max_depth in
randomforest_common.pyx constructor).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: babb23ae-89ad-42ef-abcc-df653a783eda

📥 Commits

Reviewing files that changed from the base of the PR and between 355eaf8 and e7bde34.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • python/cuml/cuml/dask/ensemble/base.py
  • python/cuml/cuml/dask/ensemble/randomforestclassifier.py
  • python/cuml/cuml/dask/ensemble/randomforestregressor.py
  • python/cuml/cuml/ensemble/randomforest_common.pyx
  • python/cuml/cuml/ensemble/randomforestclassifier.py
  • python/cuml/cuml/ensemble/randomforestregressor.py
✅ Files skipped from review due to trivial changes (3)
  • python/cuml/cuml/dask/ensemble/randomforestclassifier.py
  • python/cuml/cuml/ensemble/randomforestclassifier.py
  • python/cuml/cuml/ensemble/randomforestregressor.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • python/cuml/cuml/dask/ensemble/randomforestregressor.py

Comment thread CHANGELOG.md
Comment thread python/cuml/cuml/dask/ensemble/base.py Outdated
Comment thread python/cuml/cuml/ensemble/randomforest_common.pyx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
CHANGELOG.md (1)

3-3: ⚠️ Potential issue | 🟡 Minor

Use an H2 heading for “Breaking Changes” under the new release header.

Line 3 should be ## (not ###) to keep heading levels sequential (H1 → H2) and avoid markdownlint MD001 failures.

Suggested diff
-### 🚨 Breaking Changes
+## 🚨 Breaking Changes
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 3, Replace the third-line H3 heading "### 🚨 Breaking
Changes" with an H2 heading "## 🚨 Breaking Changes" in CHANGELOG.md so the
heading level follows the H1 → H2 sequence and avoids markdownlint MD001
failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@CHANGELOG.md`:
- Line 3: Replace the third-line H3 heading "### 🚨 Breaking Changes" with an H2
heading "## 🚨 Breaking Changes" in CHANGELOG.md so the heading level follows
the H1 → H2 sequence and avoids markdownlint MD001 failures.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: af5ca71d-ca2b-4102-b24a-1fed309906f5

📥 Commits

Reviewing files that changed from the base of the PR and between e7bde34 and adcfa83.

📒 Files selected for processing (1)
  • CHANGELOG.md

@Nzouh

Nzouh commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

Hi @hcho3, I've updated the PR to address the requested TODOs:

  • PR Description: Updated the description to link to issue Deprecate default max_depth=16 in RandomForest estimators #7945.
  • Merge Conflicts: Resolved all conflicts with the latest main branch.
  • Warning Logic:
    • Fixed the FutureWarning so it no longer triggers when max_depth=16 is set explicitly (implemented using a sentinel pattern in .pyx and key-presence checks in Dask).
    • Added stacklevel=2 so the warnings correctly attribute to the user's code.
    • Suppressed redundant worker-side warnings in Dask by explicitly passing the default value in kwargs from the client.
    • Tightened max_depth validation to catch non-integer types (like floats) early at construction time.

The PR is now ready for a final review. Thanks!

@chyunsu3

chyunsu3 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

/ok to test 59f1b73

@Nzouh

Nzouh commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@hcho3 fixed the stylistic issues

@chyunsu3

Copy link
Copy Markdown
Contributor

/ok to test 55fca14

@chyunsu3

Copy link
Copy Markdown
Contributor

/ok to test 39342b5

@Nzouh

Nzouh commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

@hcho3 fixed FutureWarning matching on the test_random_forest.py file

@chyunsu3

Copy link
Copy Markdown
Contributor

/ok to test 3dfc806

@Nzouh

Nzouh commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@hcho3 Fixed the Future warning issue

@Nzouh

Nzouh commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

@csadorf Are there any other issues you would like me to take a look at?

@chyunsu3

Copy link
Copy Markdown
Contributor

/ok to test 8e8be69

@Nzouh
Nzouh requested a review from csadorf April 26, 2026 19:31
@csadorf

csadorf commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

/ok to test 064e496

@csadorf

csadorf commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit ae8b901 into NVIDIA:main Apr 28, 2026
172 of 174 checks passed
@csadorf

csadorf commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

@Nzouh Thanks a lot for the contribution and patience in getting this through review and CI!

@csadorf Are there any other issues you would like me to take a look at?

Would you be open to have a look at #7360 ?

Even addressing just addressing it partially would be very helpful.

@Nzouh

Nzouh commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

@csadorf I'll take a look and try to address it — thanks again for all the help and guiding me through this PR!

rapids-bot Bot pushed a commit to NVIDIA/cudf that referenced this pull request Apr 29, 2026
vyasr pushed a commit to vyasr/cudf that referenced this pull request May 4, 2026
shrshi pushed a commit to shrshi/cudf that referenced this pull request May 12, 2026
rapids-bot Bot pushed a commit that referenced this pull request May 19, 2026
Closes #7982

Mirrors sklearn PR #32050 on cuml.SVC and cuml.LinearSVC. Sentinel + _effective_X property pattern, same as PR #7958. FutureWarning fires from fit when the user passes an explicit value.

Also fixes a latent bug in the accel proxy where _gpu_fit was reading self.probability truthily. Default SVC() on small data would have routed through the probability code path since the sentinel string is truthy.

Authors:
  - Steve Collins (https://github.com/switch527)
  - Jim Crist-Harif (https://github.com/jcrist)

Approvers:
  - Jim Crist-Harif (https://github.com/jcrist)

URL: #8089
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.

Deprecate default max_depth=16 in RandomForest estimators

6 participants