pysal.viz.mapclassify.K_classifiers

class pysal.viz.mapclassify.K_classifiers(y, pct=0.8)[source]

Evaluate all k-classifers and pick optimal based on k and GADF

Parameters:
y : array

(n,1), values to be classified

pct : float

The percentage of GADF to exceed

See also

gadf

Notes

This can be used to suggest a classification scheme.

Examples

>>> import pysal.viz.mapclassify as mc
>>> cal = mc.load_example()
>>> ks = mc.classifiers.K_classifiers(cal)
>>> ks.best.name
'Fisher_Jenks'
>>> ks.best.k
4
>>> ks.best.gadf
0.8481032719908105
Attributes:
best : object

instance of the optimal Map_Classifier

results : dictionary

keys are classifier names, values are the Map_Classifier instances with the best pct for each classifer

__init__(y, pct=0.8)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(y[, pct]) Initialize self.