geoplot icon indicating copy to clipboard operation
geoplot copied to clipboard

Create better concordance in the scheme parameter

Open ResidentMario opened this issue 6 years ago • 2 comments

The scheme parameter accepts either a string name of a classifier (e.g. EqualInterval) or a fitted mapclassify object (e.g. mc.EqualInterval(df, k=5)). The following changes ought to be made:

  • Currently discrete categorical binning is only possible by passing the string "categorical" to the scheme parameter. The problem is that this magic value is not at all discoverable. It really need to have an equivalent mapclassify expression: e.g. mc.Discrete.

    Also, this string should be renamed to "discrete", as "categorical" is confusing, and not a good name for a mapclassify scheme.

    See #144 for discussion and a clear use case.

  • mapclassify schemes need to be create-able in unfitted form, and you should be able to pass both an unfitted and fitted scheme to geoplot. Passing a fitted scheme is necessary for the "scheme reuse" feature, whilst passing an unfitted scheme is necessary for palatable input to plots that generate data just-in-time (e.g. quadtree), and thus are categorically opaque to the user.

Both of these changes require contribs to mapclassify.

ResidentMario avatar Nov 06 '19 15:11 ResidentMario

See this gitter comment for some notes on implementation.

ResidentMario avatar Nov 08 '19 23:11 ResidentMario

The second bullet point should now be possible due to mapclassify#51, specifically pooling.py which was added here.

ResidentMario avatar May 17 '20 23:05 ResidentMario