[MRG+2] Improved learning curves

* Changed default number of points plotted to 5, as this is enough to see shape of curve, and more can be quite expensive with complicated models.
* Refactored duplicated code in the example into a function which will be easy for users to copy, paste, and adapt.
* Changed cross-validation in example to provide a smoother curve.