I'm wondering how can machine learning approach solves a problem which has some restrictions.
Let's say we have a demand prediction problem (regression) and the demand must be less or equal than 50. Therefore, the outputs of the machine must be less or equal than 50.
In this situation, how can I keep the constraint (demand <= 50) in machine learning algorithm? The question also includes how to keep integer, equality and inequality constraints.
I think I can use a lagrangian multiplier, but I'm not sure. Can I include the constraints in the loss function of the machine?