This repository was archived by the owner on Jan 19, 2026. It is now read-only.
Budget Optimizer #189
Replies: 1 comment 2 replies
-
|
From the source code. The |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Newer to Python and having trouble with the Budget Optimizer. I run the code:
Budget Optimization
prices = jnp.ones(mmm.n_media_channels)
n_time_periods = 10
budget = jnp.sum(media_data.mean(axis=0)) * n_time_periods
extra_features_forecast = extra_features_scaler.transform(extra_features_test)[:n_time_periods]
run budget optimization
solution = optimize_media.find_optimal_budgets(
n_time_periods=n_time_periods,
media_mix_model=mmm,
extra_features=extra_features_forecast,
budget=budget,
prices=prices,
media_scaler=media_scaler,
target_scaler=target_scaler)
budget, jnp.sum(solution.x * prices)
and get the error-
AttributeError Traceback (most recent call last)
Cell In[39], line 2
1 # both values should be almost equal
----> 2 budget, jnp.sum(solution.x * prices)
AttributeError: 'tuple' object has no attribute 'x'
any ideas on what I am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions