Permalink
Browse files

Update doc, META.json, and Makefile

  • Loading branch information...
1 parent 80f318f commit 8821108ae5f87d61f6f17e284e751405126c23b5 @umitanuki committed Jul 22, 2011
Showing with 22 additions and 9 deletions.
  1. +3 −3 META.json
  2. +1 −1 Makefile
  3. +17 −4 doc/kmeans.md
  4. +1 −1 kmeans.control
View
@@ -2,13 +2,13 @@
"name": "kmeans",
"abstract": "K-means clustering as a user-defined window function",
"description": "This module provides k-means calculation over row set.",
- "version": "1.0.0",
+ "version": "1.1.0",
"maintainer": "Hitoshi Harada <umi.tanuki@gmail.com>",
"license": "postgresql",
"provides": {
"kmeans": {
"abstract": "k-means clustering function",
- "version": "1.0.0",
+ "version": "1.1.0",
"file": "kmeans.sql",
"docfile": "doc/kmeans.md"
}
@@ -24,7 +24,7 @@
}
},
"meta-spec": {
- "version": "1.0.0",
+ "version": "1.1.0",
"url": "http://pgxn.org/meta/spec.txt"
},
"tags": [
View
@@ -2,7 +2,7 @@
MODULES = kmeans
EXTENSION = $(MODULES)
-EXTVERSION = 1.0.0
+EXTVERSION = 1.1.0
EXTSQL = $(MODULES)--$(EXTVERSION).sql
DATA_built = $(MODULES).sql
View
@@ -31,17 +31,30 @@ calculates them by input vectors in the first form, you may sometimes want
to give fixed mean vectors. The vectors can be passed as 1-d array or 2-d
array of float8. In case of 1-d, the length of it must match k * lengthof(vector).
-If the third argumen, initial mean vector, is not given, it scans
+If the third argument, initial centroids, is not given, it scans
all the input vectors and stores min/max for each element of vector.
-Then decide initial values by the next formula:
+Then decide initial hypothetical vector elements by the next formula:
- init = (max - min) * (i + 1 ) / (k + 1) + min
+ init = (max - min) * (i + 1) / (k + 1) + min
-where `i` varies from 0 to k-1. This means that initial vector elements
+where `i` varies from 0 to k-1. This means that the vector elements
are decided as the liner interpolation from min to max divided by k.
+Then one of the input vectors nearest to this hypothetical vector
+is picked up as the centroid. Note that input vector is not picked
+more than twice as far as possible, to gain good result.
See input/kmeans.source as an example to call the function.
+History
+-------
+
+### v1.1.0 (2011-07-22)
+ * Fix NULL input case, thanks to the report from Mike Toews
+ * Improve initialization of centroids
+
+### v1.0.0 (2011-05-20)
+ * Initial version
+
Support
-------
View
@@ -1,5 +1,5 @@
# kmean extension
comment = 'k-means classification by window function'
-default_version = '1.0.0'
+default_version = '1.1.0'
module_pathname = '$libdir/kmeans'
relocatable = true

0 comments on commit 8821108

Please sign in to comment.