facebookexperimental / Robyn

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.
https://facebookexperimental.github.io/Robyn/
MIT License
1.08k stars 322 forks source link

robyn_clusters return error #824

Open andrewrjames opened 9 months ago

andrewrjames commented 9 months ago

Project Robyn

Describe issue

My model returns k=28 clusters and I want to use robyn_clusters to reduce the number of clusters to evaluate the model.

Provide reproducible example

cls <- robyn_clusters( input = OutputCollect, all_media = InputCollect$all_media, k = 5, limit = 5,

weights = c(1, 1, 1.5)

)

Result returns error

image

Environment & Robyn version

Make sure you're using the latest Robyn version before you post an issue.

gufengzhou commented 9 months ago

please try directly specify k in the output func as robyn_outputs(k = 5 ...). Although too many auto-clusters might mean less optimum convergence. maybe also try running longer iterations, as well as using weibull_pdf adstock and setting add_penalty_factor = TRUE in robyn_run() to give the model more freedom to find best fit.

andrewrjames commented 9 months ago

@gufengzhou Ic. Actually I've increased iterations to 3500, used weibull_pdf, and added add_penalty_factor = True, but my decomp.rssd did not converge. I have added additional variables to explain the dependent variables, such as market demand, coupon as context_vars, as well as, push notification click as organic_vars too, but the decomp.rssd still did not converge.

  1. Can we conclude the model is sufficient enough since the median of the last 200 iterations did not change much?

    image
  2. Also when I looked at one of the results, the model seems to be overfit, adjusted r2 looks good for the training data, but it becomes lower for the test data. Is this something we should worry about?

    image
  3. Additionally, the immediate vs carryover response showed a quite extreme result. For example, google sem has 100% immediate effect, while google display retargeting has complete 100% carry over effect. Intuitively, it does not really make sense to have an extreme result. Is there any reasons behind the extreme result?

    image
gufengzhou commented 9 months ago
  1. well the "convergence" should be taken with a pinch of salt, but it's true that RSSD didnt move a lot. Maybe try to further increase iterations to 5k? probably worth trying. you can reduce bit trials for less duration.
  2. Robyn doesn't forecast so far, so theoretically it doesn't matter much, and I know many just don't use ts_validation. In general, there could be many reasons why validation or test set don't fit well. Observe the actual vs predicted plot as a starter to see if the training set contains enough pattern to predict val/test at all.
  3. For weibull adstock, it needs bit more finetuning of hyperparameters to fit your intuition. look at google display's peaks/lags, does it make sense that these channels have 7-8 weeks of lag? If not, what's your expectation/ hypothesis? Then set the hyperparameters for these channels to the proper range. Explaination of hyppar setting is in demo.R