Skip to content
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
2 changes: 1 addition & 1 deletion python/cuml/cuml/ensemble/randomforestregressor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ class RandomForestRegressor(BaseRandomForestModel,

# shortcut for default accuracy metric of r^2
if self.accuracy_metric == "r2":
stats = r2_score(y_m, preds, handle=self.handle)
stats = r2_score(y_m, preds)
Comment thread
jcrist marked this conversation as resolved.
self.handle.sync()
del y_m
del preds_m
Expand Down
11 changes: 3 additions & 8 deletions python/cuml/cuml/internals/mixins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -200,7 +200,7 @@ class RegressorMixin:
)
@api_base_return_any_skipall
@enable_device_interop
def score(self, X, y, **kwargs):
def score(self, X, y, sample_weight=None, **kwargs):
"""
Scoring function for regression estimators

Expand All @@ -209,13 +209,8 @@ def score(self, X, y, **kwargs):
"""
from cuml.metrics.regression import r2_score

if hasattr(self, "handle"):
handle = self.handle
else:
handle = None

preds = self.predict(X, **kwargs)
return r2_score(y, preds, handle=handle)
return r2_score(y, preds, sample_weight=sample_weight)

@staticmethod
def _more_static_tags():
Expand Down
1 change: 0 additions & 1 deletion python/cuml/cuml/metrics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ add_module_gpu_default("accuracy.pyx" ${accuracy_algo} ${metrics_algo})
add_module_gpu_default("hinge_loss.pyx" ${hinge_loss_algo} ${metrics_algo})
add_module_gpu_default("kl_divergence.pyx" ${kl_divergence_algo} ${metrics_algo})
add_module_gpu_default("pairwise_distances.pyx" ${pairwise_distances_algo} ${metrics_algo})
add_module_gpu_default("regression.pyx" ${regression_algo} ${metrics_algo})
add_module_gpu_default("trustworthiness.pyx" ${trustworthiness_algo} ${metrics_algo})

rapids_cython_create_modules(
Expand Down
29 changes: 0 additions & 29 deletions python/cuml/cuml/metrics/regression.pxd

This file was deleted.

Loading