Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in robyn_python_notebook #1200

Open
KristiGourlay opened this issue Jan 9, 2025 · 7 comments
Open

Errors in robyn_python_notebook #1200

KristiGourlay opened this issue Jan 9, 2025 · 7 comments
Assignees

Comments

@KristiGourlay
Copy link

KristiGourlay commented Jan 9, 2025

When I run the Python Wrapper robyn_python_notebook as is, with no changes what so ever, I am getting an error when I run code block [23]
OutputModels = robyn_api('robyn_run',payload=payload)

The error is: <simpleError in names(hyper_list_all) <- *vtmp*: 'names' attribute [13] must be the same length as the vector [12]>

I also get the same error if I update the notebook with my own data and model setup (successful in R version).

Environment & Robyn version

  • Robyn version: ['3.12.0.9003']
  • R version: 4.4.2
  • Python version: 3.10.16
@KristiGourlay
Copy link
Author

Adding to this after further investigation. The issue seems to be earlier in the code. Code block [14] should be printing out the paid_media_spends, but is instead is printing out the paid_media_vars.

image image

@alxlyj alxlyj self-assigned this Jan 9, 2025
@KristiGourlay
Copy link
Author

This also seems to be the case in the R version as well. I can get Robyn to run (in both R and Python) if I set the hyper parameters with media variables, but that doesn't seem right.

Any update on this?

@ONalivajko
Copy link

Hello Kristi! In 3.12 hyperparameters ARE based on paid media vars

image

@KristiGourlay
Copy link
Author

But doesn't that affect everything downstream in the model building process and results?

image image

@gufengzhou
Copy link
Contributor

Hi both, yes the latest update allows exposure variables (paid_media_vars) to be used in modelling, a long standing ask from users. You could still opt for spend only by using spend names to fill paid_media_vars.

@KristiGourlay
Copy link
Author

KristiGourlay commented Jan 21, 2025

I don't think I understand why paid media vars would be used for budget allocation. Could you provide me a reasoning for this? Surely, If I am interested in building an MMM (which I have been doing for 2 years with Robyn), I want to compare spend to revenue and not impressions to revenue. For instance, none of the one pager makes sense anymore. Share of Total Spend, Effect & ROAS in Modeling Window -- why would I care what share of the impression a channel has. I want to know what share of the spend is attributed to it. Furthermore ROAS is about the revenue return on ad spend, not the impression return on ad spend. I understand that I can input the spend in for paid_media_vars, but then all the data I have in regards to impressions is not being used.

@gufengzhou
Copy link
Contributor

You're right that ROAS and budget allocation needs spend as input. So for the case when users opt for paid_media_vars for model fitting, Robyn will extrapolate paid_media_vars to match the spend level, see here.

The narrative of using imp/GRP etc for modeling lies in fluctuation of media buying prices, which leads to the believe that imp is more accurate than spend. It sounds intuitive and is widely accepted, although not validated. Our documentation also describes this a bit. Now you could choose whichever you think is more appropriate.

Moreover, with the new introduction of the curve calibration and the future extension, we're advocating for more model calibration, which will also compensate the extra uncertainty introduced by imp modeling.

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

No branches or pull requests

4 participants