Skip to content

Conversation

@takechanman1228
Copy link

@takechanman1228 takechanman1228 commented Jan 18, 2026

Summary

  • Fix simulate_media to floor non-positive CPC/CPM to a small positive percentile-based value (prevents divide-by-zero and inf in lifetime_clicks/impressions when additive noise drives cost <= 0).
  • Add regression test covering the deterministic CPC noise scenario that previously produced inf clicks for click channels.

Issue #43

Solution

Modified _negative_replace() to handle CPC/CPM columns specially:

  • CPC/CPM columns: Replace non-positive values with the 1st percentile of positive values (minimum 1e-6)
  • Other columns: Unchanged behavior (replace with 0)

@takechanman1228
Copy link
Author

Hi @RyanAugust , thanks for maintaining this project. Whenever you have time, could you please review this PR? Any feedback appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant