Skip to content

Commit 080ab64

Browse files
authored
Update _base.py
_make_loss_rehline_param() function now supports MAE loss. Previously, an integer was mistakenly used in the generation process of the rehline parameter U, which has now been corrected
1 parent 8066b7d commit 080ab64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rehline/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ def _make_loss_rehline_param(loss, X, y):
254254
The function supports various loss functions, including:
255255
- 'hinge'
256256
- 'svm' or 'SVM'
257+
- 'mae' or 'MAE' or 'mean absolute error'
257258
- 'check' or 'quantile' or 'quantile regression' or 'QR'
258259
- 'sSVM' or 'smooth SVM' or 'smooth hinge'
259260
- 'TV'
@@ -362,7 +363,7 @@ def _make_loss_rehline_param(loss, X, y):
362363
elif (loss['name'] == 'MAE') \
363364
or (loss['name'] == 'mae') \
364365
or (loss['name'] == 'mean absolute error'):
365-
U = np.array([[1] * n, [-1] * n])
366+
U = np.array([[1.0] * n, [-1.0] * n])
366367
V = np.array([-y , y])
367368

368369

0 commit comments

Comments
 (0)