Skip to content

Commit

Permalink
[Feature] update eval function (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
RektPunk authored Oct 1, 2024
1 parent aa2befa commit 9181925
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mqboost/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from mqboost.optimize import MQOptimizer
from mqboost.regressor import MQRegressor

__version__ = "0.2.6"
__version__ = "0.2.7"
3 changes: 1 addition & 2 deletions mqboost/objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ def _eval_check_loss(
for alpha_inx in range(_len_alpha):
_err_for_alpha = _y_train[alpha_inx] - _y_pred[alpha_inx]
_loss = _rho(error=_err_for_alpha, alpha=alphas[alpha_inx])
loss = loss + np.mean(_loss)
loss = loss / _len_alpha
loss += np.mean(_loss)
return loss


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mqboost"
version = "0.2.6"
version = "0.2.7"
description = "Monotonic composite quantile gradient boost regressor"
authors = ["RektPunk <rektpunk@gmail.com>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_eval_check_loss(dummy_data):
"""Test evaluation of the check loss."""
dtrain = dummy_data(y_true)
loss = _eval_check_loss(y_pred=y_pred, dtrain=dtrain, alphas=alphas)
np.testing.assert_almost_equal(loss, 0.012)
np.testing.assert_almost_equal(loss, 0.036)
assert isinstance(loss, float)
assert loss > 0

Expand Down

1 comment on commit 9181925

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests Skipped Failures Errors Time
91 0 💤 0 ❌ 0 🔥 6.398s ⏱️

Please sign in to comment.