How would you constrain a decision tree so its rules can be audited by hand while preserving accuracy?
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: hard
Interview Round: Other
A stakeholder requires a model whose rules can be audited by hand. How would you constrain a decision tree to stay readable while preserving accuracy?
```hint Two kinds of size
Separate the hyperparameters that bound the length of a single rule from those that bound how many rules there are.
```
```hint Choosing among small trees
Think about a selection rule that prefers the simpler tree when two trees differ in cross-validated accuracy by less than the noise in that estimate.
```
```hint Beyond the size limit
Consider what else you can change once the size is fixed: the inputs the tree sees, the targets it is trained on, or the algorithm that searches for splits.
```
### Clarifying Questions to Ask
- How many rules, and how many conditions per rule, can the auditor review in practice?
- Which metric defines accuracy here, and how large a gap from the best available model is acceptable?
- Are there features that cannot appear in the rules, such as protected attributes or derived scores the auditor cannot verify?
- Do any features have a required direction of effect, for example risk that must never fall as debt rises?
### What a Strong Answer Covers
- Direct limits on rule length and rule count, and how to set them for a human auditor.
- A principled way to choose the tree size, such as cost-complexity pruning with cross-validation and a selection rule that favors simpler trees.
- Ways to make each split carry more signal and match domain intuition.
- Methods to recover accuracy within the size limit, such as distillation or optimal sparse trees.
- How the result is validated with the stakeholder, including the accuracy gap versus an unconstrained model.
### Follow-up Questions
- How would you check that the small tree is stable, so the auditor is not reviewing rules that change with every retrain?
- If you distill a gradient-boosted model into a small tree, how do you evaluate the result?
- What would you do if the problem has three classes and the auditor also wants monotonic constraints?
- When would you recommend a points-based scorecard or sparse linear model for this stakeholder instead of a tree?
Overview: Asks how to keep a decision tree small enough for its rules to be audited by hand without giving up much accuracy. Tests tree size controls, pruning and model selection, feature design and monotonic constraints, ways to recover accuracy, and how to present the trade-off to a stakeholder.