Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
49 changes: 44 additions & 5 deletions python/cuml/cuml/accel/_wrappers/sklearn/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,53 @@
#

import cuml.ensemble
from cuml.accel.estimator_proxy_mixin import ProxyMixin
from cuml.accel.estimator_proxy import ProxyBase
from cuml.internals.interop import UnsupportedOnGPU

__all__ = ("RandomForestRegressor", "RandomForestClassifier")


class RandomForestRegressor(ProxyMixin, cuml.ensemble.RandomForestRegressor):
pass
class RandomForestRegressor(ProxyBase):
_gpu_class = cuml.ensemble.RandomForestRegressor

def _gpu_fit(self, X, y, sample_weight=None):
if sample_weight is not None:
raise UnsupportedOnGPU
return self._gpu.fit(X, y)

class RandomForestClassifier(ProxyMixin, cuml.ensemble.RandomForestClassifier):
pass
def _gpu_score(self, X, y, sample_weight=None):
if sample_weight is not None:
raise UnsupportedOnGPU
return self._gpu.score(X, y)

def __len__(self):
return self._call_method("__len__")

def __iter__(self):
return self._call_method("__iter__")

def __getitem__(self, index):
return self._call_method("__getitem__", index)


class RandomForestClassifier(ProxyBase):
_gpu_class = cuml.ensemble.RandomForestClassifier

def _gpu_fit(self, X, y, sample_weight=None):
if sample_weight is not None:
raise UnsupportedOnGPU
return self._gpu.fit(X, y)

def _gpu_score(self, X, y, sample_weight=None):
if sample_weight is not None:
raise UnsupportedOnGPU
return self._gpu.score(X, y)

def __len__(self):
return self._call_method("__len__")

def __iter__(self):
return self._call_method("__iter__")

def __getitem__(self, index):
return self._call_method("__getitem__", index)
3 changes: 3 additions & 0 deletions python/cuml/cuml/accel/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def pytest_collection_modifyitems(config, items):

reason = group["reason"]
strict = group.get("strict", True)
run = group.get("run", True)
tests = group["tests"]
condition = True
if "condition" in group:
Expand All @@ -115,6 +116,7 @@ def pytest_collection_modifyitems(config, items):
config = {
"reason": reason,
"strict": strict,
"run": run,
"condition": condition,
"extra_marker": marker,
}
Expand All @@ -131,6 +133,7 @@ def pytest_collection_modifyitems(config, items):
pytest.mark.xfail(
reason=config["reason"],
strict=config["strict"],
run=config["run"],
condition=config["condition"],
)
)
Expand Down
126 changes: 44 additions & 82 deletions python/cuml/cuml/accel/tests/scikit-learn/xfail-list.yaml

Large diffs are not rendered by default.

Loading
Loading