Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standard classification methods #30

Closed
3 tasks done
brendancol opened this issue Apr 20, 2020 · 5 comments
Closed
3 tasks done

Add standard classification methods #30

brendancol opened this issue Apr 20, 2020 · 5 comments
Assignees

Comments

@brendancol
Copy link
Contributor

brendancol commented Apr 20, 2020

We are going to port from PySAL and then give them appropriate credit...

  • Quantile
  • Equal-Interval
  • Natural Breaks (1D K-means)
@darribas
Copy link

darribas commented May 7, 2020

Hello! Thanks for this, this is awesome! I'm not sure if it makes sense, but I'll throw it just in case: do you think there'd be value in contributing back to mapclassify if you manage to make improvements? Looping @sjsrey in case it helps. Also, feel free to completely ignore, I know it might not make sense and this can be distractive. I just throught I'd mention. Thanks very much for the awesome library!

@brendancol
Copy link
Contributor Author

@darribas @sjsrey OMG yes! I checked out mapclassify and it looks great.

We would love to contribute back. A few thoughts:

  • mapclassify has a nice breadth of classify functions, and my understanding is that it integrates with geopandas / shapely correct? Maybe we could start by doing an example of using mapclassify + xarray-spatial do use the mc classifiers on xarray-based raster (wrapped numpy array).

  • have you thought about try numba for speedups? That could also be something we could contribute.

@brendancol
Copy link
Contributor Author

brendancol commented May 23, 2020

@darribas @kristinepetrosyan I've added an experimental reclassify function so we can reclassify xr.DataArrays using mapclassify breaks..stills needs testing, but at a minimum we should make sure we can take mapclassify style breaks as input. I'm going to start a separate issue and we can also add appropriates tests

@sjsrey
Copy link
Contributor

sjsrey commented May 23, 2020

@darribas @sjsrey OMG yes! I checked out mapclassify and it looks great.

We would love to contribute back. A few thoughts:

  • mapclassify has a nice breadth of classify functions, and my understanding is that it integrates with geopandas / shapely correct? Maybe we could start by doing an example of using mapclassify + xarray-spatial do use the mc classifiers on xarray-based raster (wrapped numpy array).

in terms of the relationship between geopandas and mapclassify, the former imports the latter.
mapclassify clearly has been designed to support geopandas, but it doesn't have gp as a dependency

  • have you thought about try numba for speedups? That could also be something we could contribute.

yes
Doing more of this would be great.

@darribas
Copy link

Amazing! Thanks for following up on this.

Just to throw it out there too, @slumnitz and I are supervising @MgeeeeK's Google Summer of Code this summer to make pysal in general easier to access if your data is in xarray. So far, our first steps are to build easy weights builders for DataArray objects and to sync them easily with the data stored in those.

One of the use-cases we were thinking was to feed into mapclassify, so everything we can do to avoid reinventing your wheel, we'd love to stay in sync. We're currently setting up the workflow to track progress but we can let you know in case you want to check it out/chip in on ideas or things that'd potentially be of use in your use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants