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

Using nevergrad for constraining few of the model coefficients to be positive only in ridge regression #905

Closed Siddharth8 closed 5 months ago

Siddharth8 commented 5 months ago

Hi Guys, I am working on building a Medix mix model(MMM) and using nevergrad to tune the hyper parameters. I am using the ridge regression so that it can better handle multi collinearity in my dataset (as in MMM, input variables tend to be collinear with each other). Now, what is happening is I get some of the model coefficients to be positive where as few to be negative. But in my case, I want to constrain specific coefficients to be positive only while others can be either positive or negative. Is there a way this coefficient constrain can be put using nevergrad ? I am using the below optimizer : ng.optimizers.NGOpt Can someone please help or guide me here on how to do this ?

gufengzhou commented 5 months ago

This is rather a question for Nevergrad, not Robyn. In Robyn, we use the R package glmnet to constraint the coefficient signs, while Nevergrad is for hyperaparemter optimisation. I'm sure there'll be similar capacity on Python.