Skip to main content
Question

Segmentation/Clustering of features based on attributes


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor

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

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 17, 2015
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.

jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • July 17, 2015
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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings