Just clamp the predicted value to 0? But you may also want to reconsider your model in this case; maybe a simple linear model is not appropriate.
On Tue, Jun 21, 2016 at 2:03 PM, diplomatic Guru <diplomaticg...@gmail.com> wrote: > Hello Sean, > > Absolutely, there is nothing wrong with predicting negative values but for > my scenario I do not want to predict any negative value (also, all the data > that is fed into the model is positive). Is there any way I could stop > predicting negative values. I assume it is not possible but wanted to find > out. > > Thanks. > > > On 21 June 2016 at 13:55, Sean Owen <so...@cloudera.com> wrote: >> >> There's nothing inherently wrong with a regression predicting a >> negative value. What is the issue, more specifically? >> >> On Tue, Jun 21, 2016 at 1:38 PM, diplomatic Guru >> <diplomaticg...@gmail.com> wrote: >> > Hello all, >> > >> > I have a job for forecasting using linear regression, but sometimes I'm >> > getting a negative prediction. How do I prevent this? >> > >> > Thanks. >> > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org