mapclassify.JenksCaspallForced

class mapclassify.JenksCaspallForced(y, k=5)[source]

Jenks Caspall Map Classification with forced movements.

Parameters:
ynumpy.array

\((n,1)\), values to classify.

kint (default 5)

The number of classes required.

Examples

>>> import mapclassify
>>> cal = mapclassify.load_example()
>>> jcf = mapclassify.JenksCaspallForced(cal, k=5)
>>> jcf.k
5
>>> jcf.bins
array([1.34000e+00, 5.90000e+00, 1.67000e+01, 5.06500e+01, 4.11145e+03])
>>> jcf.counts.tolist()
[12, 12, 13, 9, 12]
>>> jcf4 = mapclassify.JenksCaspallForced(cal, k=4)
>>> jcf4.k
4
>>> jcf4.bins
array([2.51000e+00, 8.70000e+00, 3.66800e+01, 4.11145e+03])
>>> jcf4.counts.tolist()
[15, 14, 14, 15]
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, k=5)[source]

Methods

__init__(y[, k])

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