Skip to content

Commit

Permalink
correcting zero devision error (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
joker2411 authored Jan 6, 2025
1 parent 5ba955e commit 8332c9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/profiles-pycorelib/attribution_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _converge(self, transition_matrix, max_iters=40, verbose=False):
def _get_removal_affects(self, transition_probs, labels, ignore_labels=["Start", "Dropoff","Converted"], default_conversion=1.):
removal_affect = {}
for n, label in enumerate(labels):
if n % (len(labels)//10) == 0:
if n % max((len(labels)//10), 1) == 0:
self.logger.info(f"Computing removal affects: {n/len(labels)*100:.2f}%")
if label in ignore_labels:
continue
Expand Down

0 comments on commit 8332c9a

Please sign in to comment.