Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RF: Fix improper documentation in dask-RF #4666

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions python/cuml/dask/ensemble/randomforestclassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ class RandomForestClassifier(BaseRandomForestModel, DelayedPredictionMixin,
* If ``False``, the whole dataset is used to build each tree.
max_samples : float (default = 1.0)
Ratio of dataset rows used while fitting each tree.
max_depth : int (default = -1)
Maximum tree depth. Unlimited (i.e, until leaves are pure), If ``-1``.
max_depth : int (default = 16)
Maximum tree depth. Must be greater than 0.
Unlimited depth (i.e, until leaves are pure)
is not supported.\n
.. note:: This default differs from scikit-learn's
random forest, which defaults to unlimited depth.
max_leaves : int (default = -1)
Maximum leaf nodes per tree. Soft constraint. Unlimited, If ``-1``.
max_features : float (default = 'auto')
Expand Down Expand Up @@ -231,8 +235,8 @@ def fit(self, X, y, convert_dtype=False, broadcast_data=False):
X_dask_cudf, y_dask_cudf = dask_client.persist([X_dask_cudf,
y_dask_cudf],
workers={
X_dask_cudf=workers,
y_dask_cudf=workers
X_dask_cudf:workers,
y_dask_cudf:workers
})

Parameters
Expand Down
12 changes: 8 additions & 4 deletions python/cuml/dask/ensemble/randomforestregressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ class RandomForestRegressor(BaseRandomForestModel, DelayedPredictionMixin,
* If ``False``, the whole dataset is used to build each tree.
max_samples : float (default = 1.0)
Ratio of dataset rows used while fitting each tree.
max_depth : int (default = -1)
Maximum tree depth. Unlimited (i.e, until leaves are pure), If ``-1``.
max_depth : int (default = 16)
Maximum tree depth. Must be greater than 0.
Unlimited depth (i.e, until leaves are pure)
is not supported.\n
.. note:: This default differs from scikit-learn's
random forest, which defaults to unlimited depth.
max_leaves : int (default = -1)
Maximum leaf nodes per tree. Soft constraint. Unlimited, If ``-1``.
max_features : float (default = 'auto')
Expand Down Expand Up @@ -223,8 +227,8 @@ def fit(self, X, y, convert_dtype=False, broadcast_data=False):
X_dask_cudf, y_dask_cudf = dask_client.persist([X_dask_cudf,
y_dask_cudf],
workers={
X_dask_cudf=workers,
y_dask_cudf=workers
X_dask_cudf:workers,
y_dask_cudf:workers
})

Parameters
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/ensemble/randomforest_common.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class BaseRandomForestModel(Base):
verbose=verbose,
output_type=output_type)

if max_depth < 0:
if max_depth <= 0:
raise ValueError("Must specify max_depth >0 ")

if (str(split_criterion) not in
Expand Down
5 changes: 3 additions & 2 deletions python/cuml/ensemble/randomforestclassifier.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ class RandomForestClassifier(BaseRandomForestModel,
max_samples : float (default = 1.0)
Ratio of dataset rows used while fitting each tree.
max_depth : int (default = 16)
Maximum tree depth. Unlimited (i.e, until leaves are pure),
If ``-1``. Unlimited depth is not supported.\n
Maximum tree depth. Must be greater than 0.
Unlimited depth (i.e, until leaves are pure)
is not supported.\n
.. note:: This default differs from scikit-learn's
random forest, which defaults to unlimited depth.
max_leaves : int (default = -1)
Expand Down
5 changes: 3 additions & 2 deletions python/cuml/ensemble/randomforestregressor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ class RandomForestRegressor(BaseRandomForestModel,
max_samples : float (default = 1.0)
Ratio of dataset rows used while fitting each tree.
max_depth : int (default = 16)
Maximum tree depth. Unlimited (i.e, until leaves are pure),
If ``-1``.\n
Maximum tree depth. Must be greater than 0.
Unlimited depth (i.e, until leaves are pure)
is not supported.\n
.. note:: This default differs from scikit-learn's
random forest, which defaults to unlimited depth.
max_leaves : int (default = -1)
Expand Down