Skip to content

Commit

Permalink
scale bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
MobiusLooper committed Aug 21, 2024
1 parent a196a72 commit 076dd2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pymc_marketing/mmm/budget_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def allocate_budget(
"No budget bounds provided. Using default bounds (0, scaled_budget) for each channel.",
stacklevel=2,
)
elif isinstance(budget_bounds, dict):
budget_bounds = {
channel: (bound[0] / self.scales.max(), bound[1] / self.scales.max())
for (channel, bound) in budget_bounds.items()
}
elif not isinstance(budget_bounds, dict):
raise TypeError("`budget_bounds` should be a dictionary.")

Expand Down

0 comments on commit 076dd2e

Please sign in to comment.