FIX loss function example

The Python API to the loss functions was lost in the last refactor.
Restored the example by defining the losses inline.
Fixed the x-axis to show "f(x)" instead of "y * f(x)".
Removed references to private APIs.
DOC: clustering: merge discussions of k-means and inertia

K-means is hard to understand without knowing what inertia is,
and we still don't have a public function for computing it.
Gets rid of an ugly TODO in the docs.