mapclassify.Percentiles

class mapclassify.Percentiles(y, pct=[1, 10, 50, 90, 99, 100])[source]

Percentiles Map Classification

Parameters:
ynumpy.array

Attribute to classify.

pctnumpy.array (default [1, 10, 50, 90, 99, 100])

Percentiles.

Examples

>>> import mapclassify
>>> cal = mapclassify.load_example()
>>> p = mapclassify.Percentiles(cal)
>>> p.bins
array([1.357000e-01, 5.530000e-01, 9.365000e+00, 2.139140e+02,
       2.179948e+03, 4.111450e+03])
>>> p.counts.tolist()
[1, 5, 23, 23, 5, 1]
>>> p2 = mapclassify.Percentiles(cal, pct = [50, 100])
>>> p2.bins
array([   9.365, 4111.45 ])
>>> p2.counts.tolist()
[29, 29]
>>> p2.k
2
Attributes:
ybnumpy.array

\((n,1)\), bin IDs for observations.

binsnumpy.array

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

kint

The number of classes.

countsnumpy.array

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

__init__(y, pct=[1, 10, 50, 90, 99, 100])[source]

Methods

__init__(y[, pct])

find_bin(x)

Sort input or inputs according to the current bin estimate.

get_adcm()

Absolute deviation around class median (ADCM).

get_fmt()

get_gadf()

Goodness of absolute deviation of fit.

get_legend_classes([fmt])

Format the strings for the classes on the legend.

get_tss()

Returns sum of squares over all 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.

plot(gdf[, border_color, border_width, ...])

Plot a mapclassifier object.

set_fmt(fmt)

table()

update([y, inplace])

Add data or change classification parameters.

Attributes

fmt

update(y=None, inplace=False, **kwargs)[source]

Add data or change classification parameters.

Parameters:
ynumpy.array (default None)

\((n,1)\), array of data to classify.

inplacebool (default False)

Whether to conduct the update in place or to return a copy estimated from the additional specifications.

**kwargsdict

Additional parameters that are passed to the __init__ function of the class. For documentation, check the class constructor.