Regression model Giving the same prediction for all new inputs until i load the model again

machine_learning
regression
prediction

#1

I have build a regression model that has some decent accuracy measures.

I have pickled it and loading it another project. However it is producing the same predictions every time when i pass new elements. After again i reloaded the model and gave the same set of new inputs then it gave new predictions and again it is producing the same outputs again and again though i have passing different inputs. This scenario repeating until i reload the model again.

The algorithm i have used Linear Regression, RandomForest Regressor.

Is there any cache issue or object defaulting it to first inputs. i was confused to understand the behavior of it. how can i proceed further.

Please anyone can suggest me. it would be really appreciated. Thank you.


#2

If i am getting this right this is an issue of random_state parameter ( seed)

In the class of your random forest regression.

there is a parameter call random_state. This parameter can be set to a number to produce reproducible results.

set random_state = None and try again.