Multiple Linear Regression with specific constraint on each coefficients on Python
I am currently running multiple linear regression on a dataset. At first, I didn't realize I needed to put constraints over my weights; as a matter of fact, I need to have specific positive & negative weights. To be more precise, I am doing a scoring system and this is why some of my variables should have a positive or negative impact on the note. Yet, when running my model, the results do not fit what I am expecting, some of my 'positive' variables get negative coefficients and vice versa. As an example, let's suppose my model is : y = W0*x0 + W1*x1 + W2*x2 Where x2 is a 'positive' variable,