# Random Forest Target/prediction maximum minimum

This is my current situation, I currently have a regression random forest that is targeting a continuous variable (sales amount) is there any configuration for the classifier that allowed me to set a maximum and a minimum for the target.

Example: Predicted sales_amount should be between 10000$$and 20000$$

thank you!!

## 3 Answers

Random Forest Regressor doesn't have such an option, usually, if you have enough data and a correct training process, predictions should be in an acceptable range. Of course, they might go above and beyond your range, but the error might be still acceptable.

If you are looking for a model that is able to utilize prediction boundaries, I suggest you look at Facebook Prophet as it may be useful for your problem at hand. Python Prophet Quick Start

For range-predictions, you can specify "Forecasting Growth":

When forecasting growth, there is usually some maximum achievable point: total market size, total population size, etc. This is called the carrying capacity, and the forecast should saturate at this point.

Here is a link for this part Forecasting Growth and Saturating Minimum

And another note - Prophet proves to be quite useful in predicting any seasonal related time series, so you can achieve even better performance predicting sales compared to Random Forest.

If in your training data you don't have any observations that are less than 10,000 and greater than 20,000, then Random Forest will never make a prediction outside of this bound. Therefore, if you eliminate these observations from the training data you will get the desired effect.

I am only suggesting this as an option, I am not familiar with your problem, so I don't know if this is a good approach or not.

According to this answer https://stats.stackexchange.com/a/205771/217009 You model prediction will always in between the training target value.Unless your training have value less than 20,000 you don't need to worry.

In this example output will not cross the input target value

In your case i assume that the training data have target value greater than 20,000.But still you want the output target less than 20,000.Two solutions are available:

• If training examples having target value greater than 20,000 is outlier or very few cases.Try to reduce the size of the tree(reduce the overfitting).
• Use the normaliser and change the output value in between 10,000 to 20,000