From 5f8d1cb5c99cccf6e5ce62fbca9c3dcd60a75292 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sat, 30 Sep 2023 23:31:35 -0400 Subject: [PATCH] Fix DeprecationWarning in local_weighted_learning.py (#9165) Fix DeprecationWarning that occurs during build due to converting an np.ndarray to a scalar implicitly --- .../local_weighted_learning/local_weighted_learning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machine_learning/local_weighted_learning/local_weighted_learning.py b/machine_learning/local_weighted_learning/local_weighted_learning.py index 8dd0e55d4..ada6f7cd2 100644 --- a/machine_learning/local_weighted_learning/local_weighted_learning.py +++ b/machine_learning/local_weighted_learning/local_weighted_learning.py @@ -122,7 +122,7 @@ def local_weight_regression( """ y_pred = np.zeros(len(x_train)) # Initialize array of predictions for i, item in enumerate(x_train): - y_pred[i] = item @ local_weight(item, x_train, y_train, tau) + y_pred[i] = np.dot(item, local_weight(item, x_train, y_train, tau)) return y_pred