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