Skip to content

Commit

Permalink
add version and exception
Browse files Browse the repository at this point in the history
  • Loading branch information
RektPunk committed Sep 18, 2024
1 parent c76d883 commit aeccbff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imlightgbm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# ruff: noqa
from imlightgbm.engine import cv, train

__version__ = "0.0.1"
5 changes: 5 additions & 0 deletions imlightgbm/objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ def _get_fobj_feval(
"""Return obj and eval with respect to task type."""
_task = type_of_target(train_set.get_label())
task_enum = SupportedTask.get(_task)
# FIXME: remove after developing multiclass objective
if task_enum != SupportedTask.binary:
raise ValueError(
"Inferred task is not binary. Multiclass classification will be supported starting from version 0.1.0."
)
feval = _get_metric(task_enum=task_enum, metric=metric)
fobj = _get_objective(
task_enum=task_enum, objective=objective, alpha=alpha, gamma=gamma
Expand Down

0 comments on commit aeccbff

Please sign in to comment.