mapclassify.Percentiles¶
-
class
mapclassify.
Percentiles
(y, pct=[1, 10, 50, 90, 99, 100])[source]¶ Percentiles Map Classification
- Parameters
- yarray
attribute to classify
- pctarray
percentiles default=[1,10,50,90,99,100]
Examples
>>> import mapclassify as mc >>> cal = mc.load_example() >>> p = mc.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 array([ 1, 5, 23, 23, 5, 1]) >>> p2 = mc.Percentiles(cal, pct = [50, 100]) >>> p2.bins array([ 9.365, 4111.45 ]) >>> p2.counts array([29, 29]) >>> p2.k 2
- Attributes
- ybarray
bin ids for observations (numpy array n x 1)
- binsarray
the upper bounds of each class (numpy array k x 1)
- kint
the number of classes
- countsint
the number of observations falling in each class (numpy array k x 1)
-
__init__
(self, y, pct=[1, 10, 50, 90, 99, 100])[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(self, y[, pct])Initialize self.
find_bin
(self, x)Sort input or inputs according to the current bin estimate
get_adcm
(self)Absolute deviation around class median (ADCM).
get_fmt
(self)get_gadf
(self)Goodness of absolute deviation of fit
get_legend_classes
(self[, fmt])Format the strings for the classes on the legend
get_tss
(self)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.
plot
(self, gdf[, border_color, …])Plot Mapclassiifer NOTE: Requires matplotlib, and implicitly requires geopandas dataframe as input.
set_fmt
(self, fmt)table
(self)update
(self[, y, inplace])Add data or change classification parameters.
Attributes
fmt
-
update
(self, y=None, inplace=False, \*\*kwargs)[source]¶ Add data or change classification parameters.
- Parameters
- yarray
(n,1) array of data to classify
- inplacebool
whether to conduct the update in place or to return a copy estimated from the additional specifications.
- Additional parameters provided in **kwargs are passed to the init
- function of the class. For documentation, check the class constructor.