[MRG+1] Enable grid search with classifiers that may fail on individual fits.

Supersedes #2587. The old pull request was so outdated (and the functionality affected was moved to different files) that I decided to re-do the work starting with a fresh checkout from master. Since this is technically a new branch, I'm opening a new pull request.
cosmetics: please remove the whitespaces at the beginning and the end of the docstring to be consistent with the PEP 257 style.