I'm performing RandomForest and AdaBoost Regression in python
My results are not reproducible [ My prediction changes everytime run the with same data and code]
seed = np.random.seed(22)
rng = np.random.RandomState(1)
param_grid = {'n_estimators': [10, 100, 1000]}
model_rfr = GridSearchCV(RandomForestRegressor(random_state = rng), param_grid, cv=3, n_jobs=-1, verbose=1)
model_rfr.fit(train_x1,train_y1)
test_rfr = model_rfr.predict(test_y1)
param_grid = {"n_estimators":[100,500],"learning_rate":list(np.linspace(0.01,1,10)),"loss":["linear", "square", "exponential"]}
model_adr = RandomizedSearchCV(AdaBoostRegressor(DecisionTreeRegressor()), param_grid,n_jobs=-1,n_iter=10,cv=3,random_state = rng)
model_adr.fit(train_x1,train_y1)
test_adr = model_adr.fit(test_y1)
Here test_adr & test_rfr values change, every single time, I run my code.
Kindly use any sample data for Regression. But please suggest how to make my result reproducible.