1
$\begingroup$

I am using statsmodels.formula.api to preform linear regression. I have used three independent variables for prediction. In some cases I am getting negative value but all the output should be positive.

Is there any way to tell the model that the output can not be negative?

import statsmodels.formula.api as smf output1 = smf.ols(formula= 'y ~A+B+C', data= data).fit() output = output.predict(my_data) 
$\endgroup$
0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.