There is an optimization problem where I have to call the predict function of a Random Forest Regressor several thousand times.
from sklearn.ensemble import RandomForestRegressor
rfr = RandomForestRegressor(n_estimators=10)
rfr = rfr.fit(X, Y)
for iteration in range(0, 100000):
# code that adapts the input data according to fitness of the last output
output_data = rfr.predict(input_data)
# code that evaluates the fitness of output data
Is there a way to increase the speed of the predict function in this case? Possibly by using Cython?