POST /patterns/cluster
Service: analytics · operationId: (none)
Required scopes
(no scope declared — review service config)
Request body
{
"type": "object",
"properties": {
"data": {
"anyOf": [
{
"type": "array",
"items": {
"type": "number"
}
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
}
]
},
"method": {
"type": "string",
"enum": [
"kmeans",
"dbscan"
],
"default": "kmeans"
},
"n_clusters": {
"type": [
"integer",
"null"
]
},
"eps": {
"type": [
"number",
"null"
]
},
"min_samples": {
"type": [
"integer",
"null"
]
},
"random_state": {
"type": [
"integer",
"null"
]
}
},
"required": [
"data"
]
}Responses
200 Cluster analysis completed
{
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"kmeans",
"dbscan"
]
},
"sample_size": {
"type": "integer"
},
"feature_count": {
"type": "integer"
},
"labels": {
"type": "array",
"items": {
"type": "integer"
}
},
"n_clusters": {
"type": "integer"
},
"silhouette_score": {
"type": [
"number",
"null"
]
},
"centroids": {
"type": [
"array",
"null"
],
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"inertia": {
"type": [
"number",
"null"
]
},
"eps": {
"type": [
"number",
"null"
]
},
"min_samples": {
"type": [
"integer",
"null"
]
},
"noise_points": {
"type": [
"integer",
"null"
]
}
},
"required": [
"method",
"sample_size",
"feature_count",
"labels",
"n_clusters",
"silhouette_score",
"centroids",
"inertia",
"eps",
"min_samples",
"noise_points"
]
}400 Invalid request
{
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"error",
"message"
]
}500 Internal error
{
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"error",
"message"
]
}Example
curl -X POST https://analytics.platform.loop.health/patterns/cluster \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'Related
services/analytics— service overview- All endpoints — directory across services
- Auth model — how scopes are enforced