Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.
We were getting some errors mapping plot_data_collect accurately to our Python data classes.
The original implementation was flattening the R plot data structure, causing loss of hierarchy and making it difficult to access plot-specific data. This was evident from the different data structure we observed:
R Original Structure (Hierarchical):
plotDataCollect[[model_id]] <- list(
plot1data = list(
plotMediaShareLoopBar = data,
plotMediaShareLoopLine = data,
ySecScale = value
),
plot2data = list(...),
plot3data = list(...),
# ... and so on
)
Project Robyn
Summary
We were getting some errors mapping plot_data_collect accurately to our Python data classes.
The original implementation was flattening the R plot data structure, causing loss of hierarchy and making it difficult to access plot-specific data. This was evident from the different data structure we observed:
R Original Structure (Hierarchical):
Python Before and After:
After:
In this PR, we:
See data_mapper.ipynb for usage examples.
Test Plan