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

Cannot plot model onepager with ts_validation = False with "non-numeric argument to mathematical function" error #946

Closed
rupatrawut opened this issue Mar 28, 2024 · 7 comments
Assignees

Comments

@rupatrawut
Copy link

rupatrawut commented Mar 28, 2024

Project Robyn

Describe issue

If I train Robyn model with ts_validation set to False, everything looks fine in training phrase. I got all the output such as pareto_aggregated.csv, etc without problem.

However, when calling robyn_outputs api via plumber, I got error message in robyn_log file as below:

Plotting 20 selected models on 7 cores...
|
| | 0%Failed exporting results, but returned model results anyways:
Error in {: task 1 failed - "non-numeric argument to mathematical function"

I also try this function but return following error.

#write one pager to specified location
load_onepager(sol='1_5_1', write=True, InputJson=InputCollect, OutputJson=OutputCollect, path=output_folder)

----> 4 load_onepager(sol='1_5_1', write=True, InputJson=InputCollect, OutputJson=OutputCollect, path=output_folder)

File c:\Users\rupatrawut\workspace\ml-marketing-mix-modeling\ml_mmm_robyn\robyn_api\python_helper.py:263, in load_onepager(InputJson, OutputJson, path, sol, top_pareto, write, max_size)
261 sol_id = sol
262 onepager = load_modeldata(sol_id,InputJson=InputJson,OutputJson=OutputJson)
--> 263 image_data = binascii.unhexlify("".join(onepager))
264 if(write==True):
265 writefile(datset=image_data,path=path,sol_id=sol_id)

Error: Odd-length string

Please note that the code can be ran without any issues, when ts_validation = True.

Environment & Robyn version

Robyn version: '3.10.5.9014'
R version: 4.3.2

Thank you for your support :)

@yu-ya-tanaka
Copy link
Contributor

Hi, I reproduced the same error on my env with setting ts_validation = False. Will check later and get back to you.

@rupatrawut
Copy link
Author

@yu-ya-tanaka Thank you :) Please keep me posted.

Another question, once we get the best range of hyperparameter when running ts_val = TRUE, should we train 100% of data using ts_val = FALSE? And insights presented in onepager (e.g., ROI, effect share, decomposition impact) are calculated from training period only or total data point?

@gufengzhou
Copy link
Contributor

For most usecases, I'd recommend to ts_validation = FALSE. Most onepager numbers are based on the entire modeling window. The training/val/test split is only for time series validation purpose. I'll let Yuya to help you with the bug.

@yu-ya-tanaka
Copy link
Contributor

Hi @rupatrawut , I have found the cause, there is a problem with the API endpoint and we are fixing it now. The fix will be completed by the end of next week.

@rupatrawut
Copy link
Author

Hi @yu-ya-tanaka. Noted with thanks :)

@yu-ya-tanaka
Copy link
Contributor

Hi @rupatrawut , We fixed bug in the API endpoint file and merged updates to the main branch. Please use the latest version of endpoint file. Thanks,
https://github.com/facebookexperimental/Robyn/tree/main/robyn_api

@rupatrawut
Copy link
Author

Hi @yu-ya-tanaka Many thanks :)

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

3 participants