Skip to content

Commit

Permalink
adds default best_iteration in more spots
Browse files Browse the repository at this point in the history
  • Loading branch information
ClimbsRocks committed Feb 13, 2018
1 parent d37b0fe commit 1aedcdb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions auto_ml/utils_model_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,11 @@ def predict(self, X, verbose=False):


if self.model_name[:4] == 'LGBM':
best_iteration = 0
best_iteration = -1
try:
best_iteration = self.model.best_iteration_
except AttributeError:
best_iteration = self.model.best_iteration
if best_iteration is None:
best_iteration = 0
predictions = self.model.predict(X, num_iteration=best_iteration)
else:
predictions = self.model.predict(X_predict)
Expand Down

0 comments on commit 1aedcdb

Please sign in to comment.