What about making risk_models a flat dictionary (taxonomy, loss_type) -> model, instead of a nested dictionary? Flat is better than nested!