Question

Segmentation/Clustering of features based on attributes


Badge +22
  • Contributor
  • 1959 replies

Hi all, has anybody done any work on 1D clustering or segmentation of features based on an attribute?

 

 

ie if you had the following attribute values 1,1,3,4,4,4,6,7,8,8 and wanted to divide them into 4 groups there are several algorithms:

equal interval:  [1,1],[3,4,4,4],[6],[7,8,8]

 

quantiles: [1,1,3],[4,4,4],[6,7],[8,8]

 

jenks optimization: [1,1],[3,4,4,4],[6,7],[8,8]

 

etc.

 

 

I'm particularly interested in jenks optimization or kernel density estimation

2 replies

Badge +3
Jenks breaking proces is described wel in WIKImath.

 

 it is basic statistics, not difficult.

 

 

 

What is a tad more difficult is creating permutations of n groups out of m values where the summ of the count is less then or equal to the the total count of numbers.

 

 

Eithe recursion or brute force.

 

Brute force is the easiest, just nesting a simple algorithm. You can do that using a couple of loops. But with large numbers you might run in large processingtimes.

 

 

Recursion with fme transformers? I think you will probably run in undefined macro problems. Havent tried it though.

 

 

n out of m algorithms can be found on sites like stack exchange or rosseta code.
Badge +22
I ended up using a python caller based on the code provided here: http://carsonfarmer.com/2010/09/playing-around-with-classification-algorithms-python-and-qgis

Reply