Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-package] Expose ObjectiveFunction class #6586

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Remove test prints
  • Loading branch information
Atanas Dimitrov committed Aug 1, 2024
commit 5d505d1ebe5b9b37c1295c7c9fcd366883ea2179
2 changes: 0 additions & 2 deletions tests/python_package_test/utils.py
Original file line number Diff line number Diff line change
@@ -175,11 +175,9 @@ def wrapper(y_pred, dtrain):
fobj = lgb.ObjectiveFunction(name, params)
fobj.init(dtrain)
(grad, hess) = fobj(y_pred)
print(grad, hess)
if fobj.num_class != 1:
grad = grad.reshape((fobj.num_class, -1)).transpose()
hess = hess.reshape((fobj.num_class, -1)).transpose()
print(grad, hess)
return (grad, hess)

return wrapper
Loading
Oops, something went wrong.