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.07k stars 323 forks source link

`nrmse_n` must be size 40040 or 1, not 40032. #970

Open AdQ-MiguelMolina opened 1 month ago

AdQ-MiguelMolina commented 1 month ago

Project Robyn

Describe issue

Hello, developers. I am getting this error and I can't find out why.

Error in `mutate()`:
ℹ In argument: `nrmse_n = .min_max_norm(.data$nrmse)`.
Caused by error:
! `nrmse_n` must be size 40040 or 1, not 40032.

I had set 4k iterations and 10 trials, I am using the latest Robyn version (Oct, 2023). I am using the Python API. And the error happens in this step.

payload = {
    'InputCollect' : json.dumps(InputCollect),
    'OutputModels' : json.dumps(OutputModels),
    'jsonOutputsArgs' : json.dumps(resultsParams)
    }
    OutputCollect = pHelper.robyn_api('robyn_outputs',payload=payload)

I don't know what can cause this error, since my dataset is less than 100 rows times 5 columns.

Thanks in advance.

AdQ-MiguelMolina commented 1 month ago

I would also add this error.

Running Pareto calculations for 24000 models on auto fronts...
<error/dplyr_error_join_matches_overflow>
Error in `left_join()`:
! This join would result in more rows than dplyr can handle.
ℹ 3234354009 rows would be returned. 2147483647 rows is the maximum number
  allowed.
ℹ Double check your join keys. This error commonly occurs due to a missing join
  key, or an improperly specified join condition.

The only thing that comes to my mind that could be causing this error, is that the data quality is bad (which is), but I don't think that should be a problem for the robyn run, I would expect just a really bad fit, which is what happens on the best data I currently have.

gufengzhou commented 1 month ago

Hi, it's hard to debug because i can't reproduce the error. My best guess for your first error might be indeed the "bad data", which might produce infinite large nrmse that got removed, thus the "size difference" error. Can you try updating the Robyn package to the latest GitHub version instead of the CRAN version first and rerun?

I haven't seen the second error so far. Can you reduce iterations and retry?