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_refresh error : Error in UseMethod("mutate") #828

Closed iraur closed 6 months ago

iraur commented 9 months ago

Project Robyn

Describe issue

🟢 I created a set of models using robyn_run and then selected a model from OutputCollect (select_model <- "5_268_6"). I then created RobynModel-5_268_6.json using robyn_write, defined a calibration_input dataframe before calling robyn_refresh.

🟢 The JSON file is successfully imported, the input data is read successfully, the feature engineering runs, and the initial model is successfully recreated according to messages.

🔴 However, on step Building refresh model #1 in manual mode I get the following error : Error in UseMethod("mutate") : no applicable method for 'mutate' applied to an object of class "NULL".

I noticed the same issue being reported here

Provide reproducible example

ℹ️ dt_input is the same dataframe that was used to build the initial model (with window_end used in robyn_inputs)

select_model <- "5_268_6" ExportedModel <- robyn_write(InputCollect, OutputCollect, select_model, export = create_files) json_file <- "Robyn_202310021749_init/RobynModel-5_268_6.json"

RobynRefresh <- robyn_refresh( json_file = json_file, dt_input = refresh_data, dt_holidays = dt_prophet_holidays, refresh_steps = 20, refresh_mode="manual", refresh_iters = 1000, refresh_trials = 5, calibration_input = calibration_input, plot_folder = "robyn_working_directory/Robyn_202310021749_init/refresh")

Environment & Robyn version

gufengzhou commented 8 months ago

Just tested it on the latest dev version and I can't reproduce your error. Would you pls install the latest and retry? remotes::install_github("facebookexperimental/Robyn/R")

iraur commented 6 months ago

Thank you very much for the reply. Closing this issue now