Skip to the content.

Back

argentina-opt: Machine Learning Optimisation Toolkit

A toolkit for the inverse of a normal regression problem. Instead of asking what output a given set of inputs produces, you give it the output you want and it searches for the input values that get you there.

An XGBoost regressor, tuned with Hyperopt, does the predicting. SciPy’s dual_annealing does the searching, and discrete variables are handled by rounding the result to the nearest allowed step. Retraining is incremental, through XGBRegressor’s xgb_model= argument. SHAP explains what the model is relying on. The interface is Streamlit, but I kept the machine learning in a separate opt_model.py so that it did not depend on the UI.

Not everything got finished. Beeswarm is the only SHAP plot implemented, discrete optimisation deserves proper mixed-integer handling, and there is no way to watch the annealing converge while it runs.

Take a look at the project in the repo.

argentina

Tech Explored

Highlights

Lowlights

Lessons Learned