KatyBrown/clustering — pull request #2 by MikeDMorgan (2014-12-17 17:56:07+00:00)
Title: refactor class_density_cluster. __init__.  Add exception handling for no...

I've done a little refactoring for the class.__init__(). Try not to recycle variable names, particularly for class attributes which may need to be accessed by other methods later on. Pass values to methods rather than accessing them with "self.attribute" within class methods.

If there aren't distinct clusters it will now raise a ValueError and spit out a, hopefully, useful message for the user. I've change the class instantiation arguments to a matrix/np.array and separate list of ids.

It should (but don't quote me) be more PEP8-friendly now too.