I am trying to use minimize function from scipy.optimize
From the documentation I was able to set bounds for x (For example: [0,12]). However I'm unable to figure out how to set them as integers.
ans = minimize(lambda x: total_rsquared(training_size, x),
[0,1,2,3,4],
method='SLSQP',
constraints=cons,
bounds=([0, 12], [0, 12], [0, 12], [0, 12], [0, 12]))
When I try with above code, x is being set to decimal values (For example: [1.0 11.1 5.4 6.9 3.4]). How do I set x values to integers?? Thanks!!