diff --git a/imlightgbm/engine.py b/imlightgbm/engine.py index b9c57dd..4c5384e 100644 --- a/imlightgbm/engine.py +++ b/imlightgbm/engine.py @@ -39,7 +39,7 @@ def predict( raw_score or pred_leaf or pred_contrib - or isinstance(_predict, spmatrix | list[spmatrix]) + or isinstance(_predict, spmatrix | list) ): return _predict diff --git a/imlightgbm/objective/core.py b/imlightgbm/objective/core.py index 4ee7cde..5e7fd80 100644 --- a/imlightgbm/objective/core.py +++ b/imlightgbm/objective/core.py @@ -10,7 +10,7 @@ def _safe_power(num_base: np.ndarray, num_pow: float): def _safe_log(array: np.ndarray, min_value: float = 1e-6) -> np.ndarray: """Safe log.""" - return np.log(np.clip(array, min_value)) + return np.log(np.clip(array, min_value, None)) def sklearn_binary_focal_objective(