🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Negative values in predictions

User: "Papad"
New Altair Community Member
Updated by Jocelyn
Hi everyone,
I am making predictions but I don't want my results to have negative values ( even if I wanted there can't be in the dataset I have).
How could I handle it?
Thanks in advance.

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Telcontar120"
    New Altair Community Member
    Accepted Answer
    @Papad The issue is that with a numerical label, although you may not have observed negative values in your training dataset, if the model is based on functions, then new input values could lead to a negative prediction via extrapolation.  The only ways to NEVER get negative predicted values would either be to use a model that inherently cannot predict negative values (such as certain types of link functions in GLM models such as Poisson or logistic) or to use a model that does not extrapolate (e.g., certain types of tree models).  Otherwise you cannot guarantee that the model will not see new input data and generate a prediction outside the previously predicted range (which could be negative).