I got regression predict values ranging from 0-6. Now I need a threshold to convert it into binary classification 0 or 1.
I tried scipy.optimize.minimize. The code is as