guillermo-navas-palencia / optbinning

Optimal binning: monotonic binning with constraints. Support batch & stream optimal binning. Scorecard modelling and counterfactual explanations.
http://gnpalencia.org/optbinning/
Apache License 2.0
434 stars 98 forks source link

Fast, greedy solver? #272

Closed patricksurry closed 7 months ago

patricksurry commented 8 months ago

Are there any plans to include an option for a (sub-optimal) fast, greedy solver? I often have ~1000 fields in exploratory analysis which is expensive at 5-10s per field with the 'cp' solver. Typically I'm optimizing from about 100 to 10 bins.

guillermo-navas-palencia commented 8 months ago

One of the fastest greedy (local-search / heuristic) solvers available in the market is LocalSolver (commercial). This solver is supported, but you need a licence. See this example: http://gnpalencia.org/optbinning/tutorials/tutorial_binary_localsolver.html.

Suppose the number of prebins is large (say 100). In that case, the problem has many decision variables, and it is unlikely you can solve it in the order of milliseconds, especially if there are several constraints involved. Here are a few options to consider:

Developing reliable heuristics satisfying constraints does require a lot of expertise. The underlying problem can be seen as a generalized assignment problem, and you can always try to relax the integrality constraints and try fixing variables. I think this type of problem is better handled using solvers.

guillermo-navas-palencia commented 7 months ago

I close this issue since no interest was shown.