pysal.viz.mapclassify.Equal_Interval

class pysal.viz.mapclassify.Equal_Interval(y, k=5)[source]

Equal Interval Classification

Parameters:
y : array

(n,1), values to classify

k : int

number of classes required

Notes

Intervals defined to have equal width:

\[bins_j = min(y)+w*(j+1)\]

with \(w=\frac{max(y)-min(j)}{k}\)

Examples

>>> import pysal.viz.mapclassify as mc
>>> cal = mc.load_example()
>>> ei = mc.Equal_Interval(cal, k = 5)
>>> ei.k
5
>>> ei.counts
array([57,  0,  0,  0,  1])
>>> ei.bins
array([ 822.394, 1644.658, 2466.922, 3289.186, 4111.45 ])
Attributes:
yb : array

(n,1), bin ids for observations, each value is the id of the class the observation belongs to yb[i] = j for j>=1 if bins[j-1] < y[i] <= bins[j], yb[i] = 0 otherwise

bins : array

(k,1), the upper bounds of each class

k : int

the number of classes

counts : array

(k,1), the number of observations falling in each class

Methods

__call__(*args, **kwargs) This will allow the classifier to be called like it’s a function.
find_bin(x) Sort input or inputs according to the current bin estimate
get_adcm() Absolute deviation around class median (ADCM).
get_gadf() Goodness of absolute deviation of fit
get_tss() Total sum of squares around class means
make(*args, **kwargs) Configure and create a classifier that will consume data and produce classifications, given the configuration options specified by this function.
update([y, inplace]) Add data or change classification parameters.
__init__(y, k=5)[source]

see class docstring

Methods

__init__(y[, k]) see class docstring
find_bin(x) Sort input or inputs according to the current bin estimate
get_adcm() Absolute deviation around class median (ADCM).
get_gadf() Goodness of absolute deviation of fit
get_tss() Total sum of squares around class means
make(*args, **kwargs) Configure and create a classifier that will consume data and produce classifications, given the configuration options specified by this function.
update([y, inplace]) Add data or change classification parameters.