Learning a threshold from a matrix
The hierarchy of methods for thresholds are:


Hand-coded thresholds
Learned thresholds with a decision tree 
Learned thresholds with an ensemble of trees (e.g., Random Forest or XGBoost)
Learned thresholds with neural networks