hclust
hierarchicalclusteringfordiploma · C function for agglomerative or divisive hierarchical clustering that writes cluster assignments back to a table.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100485 | hclust | hierarchicalclusteringfordiploma | 0.0.1 | RAG | Unknown | C |
Usage
Sources:
hclust version 0.0.1 is a diploma-project C function for hierarchical clustering. It executes a supplied SELECT through SPI, treats the first selected column as a numeric row identifier and the remaining columns as features, adds a cluster_id column to a supplied table, and updates each selected row with its assigned cluster.
Experimental invocation
The six arguments are query text, target cluster count, target table name, linkage selector, distance selector, and hierarchy selector. A minimal numeric experiment is:
Selectors are undocumented SQL constants encoded in C. The reviewed source maps linkage 1 through 4 to average, centroid, complete, and single linkage; distance 1 through 6 selects Euclidean, Chebyshev, Manhattan, cosine, Jaccard, or Sorensen logic; a or A selects agglomerative clustering.
Severe implementation limits
The project has no README, tests, release notes, or compatibility matrix. It uses fixed 100-feature and short label buffers, converts values from text with minimal validation, emits extensive server messages, and contains unfinished or incorrect mathematical paths. Table names and row labels are interpolated into ALTER and UPDATE commands with fixed-size sprintf buffers rather than identifier or literal quoting. The supplied SELECT is also executed verbatim.
Only a superuser in an isolated disposable database should test hclust, using hard-coded trusted identifiers and input. Do not expose the function to users, do not run it against valuable tables, and do not treat its cluster assignments as validated analytical output.