Adding rule on top of ML to manipulate RMSE I am currently working on a regression problem to predict customer revenue in the next 3 or 6 months etc.
So, am currently using different regression approaches. However, I see that the predicted y values are negative (for monetary value). but monetary value cannot be negative.
But my R2 value is 90% in train and 82% in test set. However, when I find out the minimum value in predicted Y values, they are negative. My RMSE is around 60K in train and 65K in test. The actual values for revenue range from 9.8 to 6980753
So, do you think it is appropriate to introduce a rule (on top of my ML output) to say convert/replace all predicted negative monetary values to zero.
Something like below in python
np.where(y_pred<0,0,y_pred)

Would this indicate I am messing up with the model result and it is not ethical to do this? Because negative values don't make sense anyway. At least replacing them with zeroes would improve the performance metrics like RMSE or R2. I don't intend to do this but would like to know what is appropriate and right thing to do

The "correct" way to ensure nonnegative predictions is to use an appropriate distributional family. You could use a count data family, like negative binomial regression (see Hilbe's textbook), since revenue is in principle discrete... but the numbers are typically so high that you could also use a continuous distribution, like a gamma regression or similar. If there is a high incidence of zeros, you could look at zero-inflated models.
Alternatively, a far simpler method that may be quite enough for your applications would be to indeed simply truncate your predictions at zero. You would need to think about whether the added complexity of a "better" model is outweighed by a better outcome than that achieved by a simple truncation.
