mapclassify.KClassifiers¶
- class mapclassify.KClassifiers(y, pct=0.8)[source]¶
Evaluate all \(k\)-classifers and pick optimal based on \(k\) and GADF.
- Parameters:
- y
numpy.array \((n,1)\), values to be classified.
- pct
float(default0.8) The percentage of GADF to exceed.
- y
- Attributes:
- best
MapClassifier Instance of the optimal
MapClassifier.- results
dict Keys are classifier names, values are the
MapClassifierinstances with the bestpctfor each classifier.
- best
See also
Notes
This can be used to suggest a classification scheme.
Examples
>>> import mapclassify >>> cal = mapclassify.load_example() >>> ks = mapclassify.classifiers.KClassifiers(cal) >>> ks.best.name 'FisherJenks'
>>> ks.best.k 4
>>> float(ks.best.gadf) 0.8481032719908105
Methods
__init__(y[, pct])