scikit-learn/scikit-learn — pull request #1859 by tjanez (2013-04-14 16:17:16+00:00)
Title: FIX ENH LeaveOneLabelOut and LeavePLabelOut's handling of labels

I've fixed `LeaveOneLabelOut` and `LeavePLabelsOut`'s handling of labels as discussed with @larsmans:
https://github.com/scikit-learn/scikit-learn/pull/1775#discussion-diff-3373086.

Here is the summary of changes:
- copying of `labels` is done in `__init__` instead of `__iter__`
- redundant calls to `unique` function are removed
- a test case is added that checks if `LeaveOneLabelOut` and `LeavePLabelsOut` handle changing of `labels` variable properly (current `master` fails the test).