How do I force specified coefficients in a Linear Regression model to be positive? Looking for a way to do this in Python. scipy.optimize.nnls forces all coefficients to be positive.

Some additional context: I have a data frame with a some explanatory variables and a response variable. When I run a regular linear regression, the coefficients of some explanatory variables become negative. This is okay for some variables, but not for all. I want to prevent the coefficients of specific variables from becoming negative.

I want to force these coefficients to be positive because they should have a positive contribution to the response. The variables I want to have positive coefficients are investment dollars in a few different channels. The response is revenue. I don't want my model to say that investing more dollars in a certain channel lowers revenue (even if that creates a more accurate model).
Sorry, but on the surface, this sounds like a terrible idea to me: if linear regression gives you negative coefficients for some explanatory variables that you think should be positive, then it means that either your data is "wrong" (typically noisy or too small) or your intuition is misguided. 

I can't see any good reason why one would use a data-driven approach if the goal is to manually force the model in a particular way. This is the equivalent of breaking the thermometer to hide the fever.

I'd suggest the following instead:


In general an unexpected outcome is arguably a good thing, in the sense that it tells us something we didn't know about the data. That's a cue to investigate what happens in the data. Linear regression is simple enough to analyze: one can look at the correlation, plot the relation between the variables etc.
If there's really something suspicious going on with some variables, maybe some errors in the data which make them behave in a way they shouldn't, then it's much better to discard them altogether from the model rather than fixing their coefficient, because this way the model won't rely on them at all.