# What kind of loss function should be used for a problem like this?

My dataset consists of hierarchical timeseries. One could imagine it as "total sales" and segmentation per product. Something like this:

|----------------|---------|-------|--------|
| Type           | m(0)    | m(n)  | m(n+1) |
|----------------|---------|-------|--------|
| Total sales    | 1000    | 1100  | 1250   |
|----------------|---------|-------|--------|
| Prod_1         | 250     | 210   | 265    |
|----------------|---------|-------|--------|
| Prod_2         | 750     | 890   | 985    |
|----------------|---------|-------|--------|


There are around 20 different "products". The challenge is to predict the m(n+1) values using a neural network. However, there is a catch. We're predicting a numeric value, but we're evaluating it in a classification-like way. If the prediction is off by 5% (in both directions), the prediction is considered to be wrong; this is the metric that is being used for evaluating the model. So in a way this a a hybrid regression/classification problem.

The question is, knowing the evaluation metric, what kind of loss function would you use? Would it be better to use a regression loss function? Or would it make sense to use a custom classification-like loss function? Are there other approaches that could be used here?