# Use both during optimization
result = optimizer.optimize_prompt(
    prompt=my_prompt,
    dataset=training_dataset,
    validation_dataset=validation_dataset,
    metric=my_metric,
)
```

**Split recommendations:**

* **70/30 or 80/20** is standard for training/validation splits
* **Ensure diversity** in both sets to cover different scenarios
* **Keep validation data unseen** during prompt development
* **Use the same distribution** in both sets to ensure valid evaluation

### Testing on held-out data

After optimization completes, evaluate the final prompt on a completely held-out test dataset to confirm it generalizes to production scenarios:

```python
from opik.evaluation import evaluate_prompt