build a classification model under constraint
As Peter said, this is exactly the sort of problem logistic regression can work on directly. But, there are a few more things to say.

The binning that happens on your raw variables suggests there's some strong nonlinearity. You could do some univariate analysis to find suitable transformations, but in particular you could try binning, possibly with weight-of-evidence scoring and/or tree-based recursive partitioning.

If you want to insist on preserving the binning structure and the $x'$ values, then it's just straightforward logistic regression with these transformed predictors.

If you insist on preserving the binning structure but not their $x'$ values, you could again go with WOE or, one-hot encode for these bins and learn the $w_i x_i'$ products as the coefficients of the encoded variables in a logistic regression.

Finally, of course, you can replace almost any time I mentioned logistic regression with your favorite classifier.