py-clustermmap's Introduction
See also: http://www.aaronland.info/weblog/2009/05/02/yakshed/#turkishmmap -- clusterMMap class clusterMMap | clusterMMap - generate a set of clusters and orphaned points for a list of coordinates | | Methods defined here: | | __init__(self) | Create a new clusterMMap object. Just like that! | | clusters(self, coords, k=None) | Return a tuple containing the set clustered (sorted) and orphaned | points. Specifically: | | This starts off as plain old K-Means clustering where, in the absence | of a user-defined value of K, the square-root of the number of markers | is used. After the initial clustering is done the results are filtered | to prevent any single cluster from containing more than nine points | (that should probably be configurable). Any that exceed the limit continue | to be re-crunched (with a K value of 2) until they meet expectations and | even then they are subject to an additional distance test to ensure that | outliers don't get grouped with something that's actually too far away. | That may mean that they end up as "orphan" points but there are hoops to | try and account for that too. | | The clusters are then further simplified by generating a convex hull, or | more precisely tested to see if there are enough points to create a hull. | If not, all the points in that clustered are treated as orphans. So, now | we have a bunch of polylines and orphan points. If the bounding box for | any one polyline contains the bounding box for another polyline or the | bounding box of polyline x intersects polyline y (the actual polyline, not | the bounding box) then the two are merged. Finally, each orphaned point is | tested to see whether it is contained by any of the bounding boxes for the | remaining polylines (and added to that cluster if it does). | | Coords is a list of lists whose elements are (latitude, longitude). DATA __author__ = 'Aaron Straup Cope' __copyright__ = 'Copyright (c) 2009 Aaron Straup Cope. BSD license : h... __date__ = '$Date: 2009/05/09 17:05:27 $' __package__ = 'clusterMMap' __url__ = 'http://github.com/straup/py-clusterMMap' __version__ = '0.2' VERSION 0.2 DATE $Date: 2009/05/09 17:05:27 $ AUTHOR Aaron Straup Cope
py-clustermmap's People
Forkers
imclabRecommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.