Minimising MAPE for a constant predictor

28 Views Asked by At

I have a constant predictor $f(x_i) = C$, and a set of true labels $y_i \geq 1$

How to find explicit formula for the C which minimises Mean Absolute Percentage Error (MAPE), that is:

$$ \sum_{i=1}^n \left|\frac{y_i-C}{y_i} \right|\rightarrow \min_{C} $$

I tried taking sub-derivative, and found that I need to somehow equate to zero the following:

$$ \sum_{i=1}^n \frac{sign(y_i-C)}{y_i} =0 $$

but I have no idea where to go next. I know that I can use some optimisation or iterative methods, but I want to get an explicit equation for $C$.