K-means clustering with silhouette k-selection
predictive-analytics_kmeans-clusterLloyd k-means with k-means++ seeding, optional standardisation, nInit restarts, silhouette and inertia for a k range, and stable label renumbering. Price $0.04 USDC. POST /api/v1/predictive-analytics/kmeans-cluster. An unpaid call returns the x402 payment terms and does not run.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"columns": "<columns>",
"rows": "<rows>"
},
"name": "predictive-analytics_kmeans-cluster"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | k, integer, from 2 to 50. Optional. | |
| rows | Yes | rows, array. Required. | |
| seed | No | seed, integer, from -9007199254740991 to 9007199254740991. Required. | |
| nInit | No | nInit, integer, from 1 to 50. Required. | |
| kRange | No | kRange, array. Optional. | |
| columns | Yes | columns, array. Required. | |
| maxIter | No | maxIter, integer, from 1 to 1000. Required. | |
| standardize | No | standardize, boolean. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | k. Number. | |
| caps | No | caps. Object. | |
| labels | No | labels. Array. | |
| inertia | No | inertia. Number. | |
| sources | No | sources. Array. | |
| rowsUsed | No | rowsUsed. Number. | |
| centroids | No | centroids. Array. | |
| kSelection | No | kSelection. Array. | |
| silhouette | No | silhouette. Number. | |
| droppedRows | No | droppedRows. Number. | |
| limitations | No | limitations. Array. |