Comments (12)
Thank you for the swift response @pabloduque0! Look forward to the fixes
from lightweight_mmm.
@yanhong-zhao-ef Thanks for opening this one!
This is a known issue which we found recently and we will be sending out a fix in the upcoming days.
from lightweight_mmm.
Hello @yanhong-zhao-ef !
Should be fixed.
But let me know if you spot any inconsistencies.
from lightweight_mmm.
will test this out and report back thanks @pabloduque0
from lightweight_mmm.
Hey @pabloduque0 just tested the latest code and I seem to run into this issue when plotting the results:
loc("jit(_unstack)/jit(main)/squeeze[dimensions=(0,)]"("/Users/yanhongzhao/miniforge3/lib/python3.9/site-packages/matplotlib/cbook/__init__.py":1647:1)): error: 'mhlo.reshape' op requires the same element type for all operands and results loc("jit(_unstack)/jit(main)/squeeze[dimensions=(0,)]"("/Users/yanhongzhao/miniforge3/lib/python3.9/site-packages/matplotlib/cbook/__init__.py":1647:1)): error: 'mhlo.reshape' op requires the same element type for all operands and results
from lightweight_mmm.
Hello @yanhong-zhao-ef ,
What version of matplotlib are you using? Make sure is matplotlib==3.3.4
.
If its not that I would need a reproducible code example (or colab).
But by the looks of it, it might be tied to some version missmatch as our test pass correctly and in the updated examples plot works fine.
from lightweight_mmm.
Hey @pabloduque0 I have updated the dependencies to be matplotlib==3.3.4 and the problem seems to be that the previous budget allocation and optimised budget are of different types of array for some reason:
So I did
print(previous_budget_allocation)
print(optimal_buget_allocation)
print(jnp.shape(previous_budget_allocation))
print(jnp.shape(optimal_buget_allocation))
print(previous_budget_allocation.dtype)
print(optimal_buget_allocation.dtype)
print(type(previous_budget_allocation))
print(type(optimal_buget_allocation))
Where previous budget allocation is from the starting values
and here is the output:
[1.74966221e+04 4.61873158e+03 3.51868975e+05 1.65627613e+05
2.46767943e+03 2.50870759e+01 1.32379315e+03 3.06571498e+05]
[1.93767937e+05 8.06692206e+04 3.55350656e+05 1.67266469e+05
2.81926225e+04 1.72227177e+02 2.14848183e+04 3.09604983e+03]
(8,)
(8,)
float64
float64
<class 'jaxlib.xla_extension.DeviceArray'>
<class 'numpy.ndarray'>
When I plot like this the whole thing works:
budget_allocation_plot = plot.plot_pre_post_budget_allocation_comparison(
media_mix_model=mmm_model_obj,
kpi_with_optim=solution["fun"],
kpi_without_optim=kpi_without_optim,
optimal_buget_allocation=optimal_buget_allocation,
previous_budget_allocation=jnp.array(previous_budget_allocation),
figure_size=(10, 10),
)
from lightweight_mmm.
Yes, indeed they are different type. We updated a bit the naming and order of things in the notebook so it is more clear now, hopefully following that helps:
from lightweight_mmm.
All good thank you!
from lightweight_mmm.
@yanhong-zhao-ef thanks for reporting back!
from lightweight_mmm.
Hi when will this be included as a release on PyPi?
from lightweight_mmm.
@itaher-aclu v0.1.6 Is just live now! :)
from lightweight_mmm.
Related Issues (20)
- How can I calibrate my predicted ROI in the MMM with my geolift result ? HOT 3
- How can I run kind of gridsearch to find the best custom priors for a hill_adstock or carryover model ?
- How can I input future media_data_test for optimization in upcoming periods? HOT 1
- How can channel-wise optimized conversions be obtained?
- Extra features
- Addressing Heteroscedasticity
- Geo level attribution and response curves
- Budget Allocation Percentage breakdown by channel HOT 10
- Question on tensorflow requirement
- Dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX. HOT 5
- Same pre-optimization and post-optimization channel budget allocation ratios , but suggesting much higher budget instead of aligning the budget to the one i requested. HOT 10
- Paid Search bias - Nested model
- Divergences and n_eff
- Outliers and influential points
- budget allocator: How to set up lower bound and upper bound per channel?
- add got incompatible shapes for broadcasting: (95,), (90,). HOT 5
- TypeError: add got incompatible shapes for broadcasting: (58,), (54,). HOT 8
- Rendering of several plots not working! HOT 1
- Negative Values in Pre optimization predicted Target vs Post optimization predicted Target
- Budget Optimization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightweight_mmm.