# Human-in-the-Loop

> Incorporates human feedback into the ML pipeline to collect explicit labels.

- **Category**: Data Science
- **Subcategory**: ML Workflows
- **Canonical URL**: https://designpattern.fyi/patterns/human_in_the_loop/

---

## Description
**Context**: For supervised learning systems, collecting high-quality labels is essential. Human-in-the-loop patterns incorporate human judgment at key points in the pipeline.


## Use Cases
When ML systems require human feedback for training, validation, or active learning.



## Implementation Example

```python
# Human-in-the-Loop
feedback = human_reviewer.label(predictions)
model.update_with_feedback(feedback)
```



## Trade-offs


### Advantages

- - Improves label quality

- - Enables active learning

- - Handles edge cases




### Considerations & Drawbacks

- - Slower than automated labeling

- - Human bottleneck

- - Higher cost







---
**Reference**: [Original Source](https://eugeneyan.com/writing/more-patterns/)

