mapclassify.FisherJenksSampled¶

class mapclassify.FisherJenksSampled(y, k=5, pct=0.1, truncate=True)[source]

Fisher Jenks optimal classifier - mean based using random sample.

Parameters:
ynumpy.array

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

kint (default 5)

The number of classes required.

pctfloat (default 0.10)

The percentage of $$n$$ that should form the sample. If pct is specified such that $$n*pct > 1000$$, then $$pct = 1000./n$$, unless truncate is False.

truncatebool (default True)

Truncate pct in cases where $$pct * n > 1000.$$.

Notes

For theoretical details see [RSL16].

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, pct=0.1, truncate=True)[source]

Methods

 __init__(y[, k, pct, truncate]) 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. plot_histogram([color, linecolor, ...]) Plot histogram of y with bin values superimposed 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.