Skip to content

Commit

Permalink
fix: adapt changed variable name loss_ to _loss in scikit-learn 1.1.0…
Browse files Browse the repository at this point in the history
…rc1 (#23079)
  • Loading branch information
iamDecode committed Apr 25, 2023
1 parent fc7b230 commit 81bf08c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sklearn_pmml_model/ensemble/gb.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ def __init__(self, pmml):

if self.n_classes_ == 2 and len(segments) == 3 and segments[-1].find('TreeModel') is None:
# For binary classification where both sides are specified, we need to force multinomial deviance
self.loss_ = _gb_losses.MultinomialDeviance(self.n_classes_ + 1)
self.loss_.K = 2
try:
self.loss_ = _gb_losses.MultinomialDeviance(self.n_classes_ + 1)
self.loss_.K = 2
except AttributeError:
self._loss = _gb_losses.MultinomialDeviance(self.n_classes_ + 1)
self._loss.K = 2

try:
self.init = None
Expand Down

0 comments on commit 81bf08c

Please sign in to comment.