I have a regression use case where I am supposed to estimate a value based on 3-4 features. Using random forest, I was able to get ~20% error. However, I have a constraint now. I can overestimate but not underestimate. So, at the cost of improving the error I am allowed to overestimate. What is the right approach of handling this constraint? Is it okay to just go with an approach like 1.2x the estimation provided by the model?

  • 3
    $\begingroup$ Use an asymmetric loss function. Do you mean you absolutely can not underestimate or is it simply somewhat more expensive to do so? The former might yield unexpected and undesired results, so be sure what you want. $\endgroup$ – Emre May 24 '17 at 9:03
  • $\begingroup$ @Emre Let me frame the question as: I want to overestimate x(=99%) of times and preferably with an error margin of y. So I have to minimize error while overestimating. $\endgroup$ – dknight May 24 '17 at 9:06
  • $\begingroup$ @NeilSlater my bad in terms of phrasing the question. Of course, it is data dependent. So, I rephrased the question in the above comment. $\endgroup$ – dknight May 24 '17 at 9:10

Use an asymmetric loss function with a cliff at your margin; e.g.,

$\mathcal L (x) \equiv \begin{cases} x^2 && x > 0\\ c x^2 && -m < x < 0 \\ d x^{2p} && x < -m \end{cases}$

where $c>1$, $p>1$, $d\equiv cm^{2-2p}$. The idea is to encode your constraints in your loss function.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.