post https://api-lib.bambu.life/api/customerSegmentation/v2/similarity
This endpoint maps the clusters with different persona based on euclidean distance, and returns probability of how similar the cluster to the chosen persona.
Request Body
Name | Datatype | Description | Mandatory | Sample Value | Notes |
---|---|---|---|---|---|
clusterInfo | Dictionary | Information of each cluster: their respective count, as well as 25th, 50th, and 75th percentile values for numerical features. | Yes | { "clusterInfo": [ { "clusterNumber": 0, "count": 106, "numericFeaturesInfo": { "percentile": [ { "features": [ { "name": "age", "value": 28 }, { "name": "savingsRatio", "value": 0.41228 }, { "name": "personalIncome", "value": 5172 } ], "percentileValue": 25 }, … ] }, { "clusterNumber": 1, "count": 367, "numericFeaturesInfo": { "percentile": [ { "features": [ { "name": "age", "value": 31 }, { "name": "savingsRatio", "value": 0.46241 }, { "name": "personalIncome", "value": 5038 } ], "percentileValue": 25 }, … ] }, … ]} | Input structure template:{ "clusterInfo": [ { "clusterNumber": 0, "count": 106, "numericFeaturesInfo": { "percentile": [ { "features": [ … ], “percentialeValue”: 25 }, { "features": [ … ], “percentialeValue”: 50 }, { "features": [ … ], “percentialeValue”: 75 }, ] }, { … }, { … } ]} |
Response Body
Name | Datatype | Description | Sample Value | No. of decimals | Notes |
---|---|---|---|---|---|
clusterNumber | Integer | Number of groups to segment the dataset | “clusterNumber”: 0 | 0 | |
output | Array of Dictionary | Contain 4 information: distance, id, persona and probability | "output": [ { "distance": 0.18727, "id": 4, "persona": "Pragmatist", "probability": 0.28509 }, { "distance": 0.19418349582716743, "id": 6, "persona": "Sophisticated Opportunist", "probability": 0.2792360861544882 } ] | ||
distance | Number | Metric used to calculate the similarity of the cluster to persona | "distance": 0.17702 | 5 | |
id | Integer | ID of the clusters persona(s), valid values are: 1, 2, 3, 4, 5, 6 | "id": 3 | 0 | |
persona | String | Describe the cluster’s attributes and traits based on the chosen persona | "persona": "Adventurer" | 6 possible personaAdventurer, Skeptic, Sophisticated Opportunist, Traditionalist, Pragmatist, Hunter | |
probability | Number | Probability of how similar the cluster to the chosen persona | "probability": 0.58798 | 5 |