facebookexperimental / facebookexperimental/Robyn

Error while exporting plots

Đang mở
#1,059 4 bình luận 0 reaction 1 người được giao Được @gufengzhou nhận Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
1.5k
Fork
433
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Project Robyn

## Describe issue
Getting a weird error while saving `pareto_alldecomp_matrix.csv`: `>> Exporting general plots into directory...
Failed exporting results, but returned model results anyways:
Error in theme[[element]]: attempt to select more than one element in vectorIndex`

All other files are generated correctly:

![image](https://github.com/user-attachments/assets/ba10f5e7-e774-462d-9f02-98293db0196f)

## Provide reproducible example

I am using following code:
```
InputCollect <- robyn_inputs(
dt_input = data,
dt_holidays = dt_prophet_holidays,
date_var = date_column, # date format must be "2020-01-01"
dep_var = target_variable, # there should be only one dependent variable
dep_var_type = "conversion", # "revenue" (ROI) or "conversion" (CPA)
prophet_vars = c("trend", "season", "holiday"), # "trend","season", "weekday" & "holiday"
prophet_country = "US", # input country code. Check: dt_prophet_holidays
context_vars = contextual_variables,
paid_media_spends = selected_paid_media_spends,
paid_media_vars = selected_paid_media_vars,
window_start = as.Date(lower_limit_date),
window_end = as.Date(upper_limit_date),
adstock = "geometric", # geometric, weibull_cdf or weibull_pdf.
)
hyperparameters <- create_hyperparameter_ranges(selected_paid_media_spends)
InputCollect <- robyn_inputs(InputCollect = InputCollect, hyperparameters = hyperparameters)

printlog("Running Robyn")
OutputModels <- robyn_run(
InputCollect = InputCollect, # feed in all model specification
cores = NULL, # NULL defaults to (max available - 1)
iterations = 2000, # 2000 recommended for the dummy dataset with no calibration
trials = 5, # 5 recommended for the dummy dataset
ts_validation = TRUE, # 3-way-split time series for NRMSE validation.
add_penalty_factor = TRUE # Experimental feature. Use with caution.
)
plot_folder <- paste0(robyn_directory, job_run_id, '/', state)
dir_exists <- dir.exists(plot_folder)
if (!dir_exists) {
dir.create(plot_folder, recursive = TRUE)
}

printlog("Collecting Robyn Outputs")
OutputCollect <- robyn_outputs(
InputCollect, OutputModels,
pareto_fronts = "auto",
csv_out = "all", # "pareto", "all", or NULL (for none)
clusters = TRUE, # Set to TRUE to cluster similar models by ROAS. See ?robyn_clusters
export = TRUE, # this will create files locally
plot_folder = plot_folder, # path for plots exports and files creation
plot_folder_sub = "",
plot_pareto = FALSE # Set to FALSE to deactivate plotting and saving model one-pagers
)
```

## Environment & Robyn version
Make sure you're using the latest Robyn version before you post an issue.
- Check and share Robyn version: `packageVersion("Robyn")`
- R version (Please, check and share: `sessionInfo()` or `R.version$version.string`)

I can confirm that the Robyn version is: `3.11.1`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.