Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5f8d1cb

Browse files
Fix DeprecationWarning in local_weighted_learning.py (TheAlgorithms#9165)
Fix DeprecationWarning that occurs during build due to converting an np.ndarray to a scalar implicitly
1 parent aaf7195 commit 5f8d1cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎machine_learning/local_weighted_learning/local_weighted_learning.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def local_weight_regression(
122122
"""
123123
y_pred = np.zeros(len(x_train)) # Initialize array of predictions
124124
for i, item in enumerate(x_train):
125-
y_pred[i] = item @ local_weight(item, x_train, y_train, tau)
125+
y_pred[i] = np.dot(item, local_weight(item, x_train, y_train, tau))
126126

127127
return y_pred
128128

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /