Skip to content

Commit

Permalink
Merge pull request #7 from forin-xyz/master
Browse files Browse the repository at this point in the history
Update lambdamart.py
  • Loading branch information
jma127 authored Jul 21, 2017
2 parents 98addcb + 7edc56e commit e393677
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyltr/models/lambdamart.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _update_terminal_regions(self, tree, X, y, lambdas, deltas, y_pred,
terminal_region = np.where(masked_terminal_regions == leaf)
suml = np.sum(lambdas[terminal_region])
sumd = np.sum(deltas[terminal_region])
tree.value[leaf, 0, 0] = 0.0 if sumd == 0.0 else (suml / sumd)
tree.value[leaf, 0, 0] = 0.0 if abs(sumd) < 1e-300 else (suml / sumd)

y_pred += tree.value[terminal_regions, 0, 0] * self.learning_rate

Expand Down

0 comments on commit e393677

Please sign in to comment.