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 322 forks source link

How do I solve the Robyn Error: Input 'factor_vars' must be any from 'context_vars' inputs #944

Open skonduri-sreeja opened 3 months ago

skonduri-sreeja commented 3 months ago

Project Robyn

Describe issue

Error in check_factorvars(dt_input, factor_vars, context_vars) : Input 'factor_vars' must be any from 'context_vars' inputs

Provide reproducible example

context_vars = c( "A", "B", "C")

factor_vars = c("event", "defects", "fraud", "outage")

this is part of the MMM code and used to run before and now there is an error. There are no null values in dataset

Environment & Robyn version

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

packageVersion("Robyn") [1] ‘3.10.6.9003 R.version$version.string [1] "R version 4.3.1 (2023-06-16 ucrt)"

gufengzhou commented 2 months ago

Robyn only accepts factorial variables within context_vars. If you want to have "event", "defects", "fraud", "outage" as factors, you need to do context_vars = c( "A", "B", "C", "event", "defects", "fraud", "outage"), then factor_vars = c("event", "defects", "fraud", "outage").