I have this Random forest model where X_train, X_test as well as y_train, y_test are numpy arrays of shape of (1,n) and (1,m) i.e. input consists of only one feature
model_1 = RandomForestRegressor(n_estimators=50,random_state=42)
model_1.fit(X_train.reshape(-1,1), y_train.reshape(-1,1))
print(model_1.score(X_test.reshape(-1,1), y_test.reshape(-1,1)))
which works totally fine to fit training data and then also gives a score of around 0.95 respectively for test data but now if I want to predict for
future = np.array([int(i) for i in range(len(X)+1,len(X)+11)])
so future is
array([155, 156, 157, 158, 159, 160, 161, 162, 163, 164])
I did this :
model_1.predict(future.reshape(-1, 1))
But in the output I got all same values
array([2985.02, 2985.02, 2985.02, 2985.02, 2985.02, 2985.02, 2985.02,
2985.02, 2985.02, 2985.02])
Can somebody tell me why I am getting all predictions to be a same number ? and this is just not happening for 10 future values but even for 100 values. Is there any other way to predict results manually ?
model_1.predict(X_test.reshape(-1,1))?{X|y}_trainand{X|y}_testthat would show the problem? I don't know if that would involve restructuring your whole model, but if it doesn't, it would help to be able to reproduce your problem.