kmeans_cluster
Groups rows into clusters based on numeric columns, standardizing features automatically and storing the cluster assignment as a new column for segmentation or pattern discovery.
Instructions
K-Means clustering. Assigns each row to one of n_clusters groups based on numeric columns. Features are auto-standardized before clustering. Result is stored as a new column. Use for customer segmentation, anomaly grouping, or discovering natural data groups. Example: kmeans_cluster(columns=["Revenue","ChargeableWeight","Pieces"], n_clusters=4)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columns | Yes | ||
| df_name | No | ||
| n_clusters | No | ||
| random_state | No | ||
| cluster_column | No | cluster |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |