https://www.brainiac.software/api/v1/predictive-analytics/kmeans-cluster$0.04 USDCK-means clustering with silhouette k-selection
Lloyd k-means with k-means++ seeding, optional standardisation, nInit restarts, silhouette and inertia for a k range, and stable label renumbering.
Body
| Field | Required | Notes |
|---|---|---|
columns | Yes | array; Array |
rows | Yes | array; Array |
k | No | integer |
kRange | No | array |
standardize | No | boolean; Default: true |
seed | No | integer; Default: 42 |
nInit | No | integer; Default: 10 |
maxIter | No | integer; Default: 300 |
Request exampleJSON
{
"columns": [
"x",
"y"
],
"rows": [
[
1,
1
],
[
1.5,
2
],
[
2,
1.5
],
[
1.2,
1.4
],
[
8,
8
],
[
8.5,
9
],
[
9,
8.2
],
[
8.2,
8.8
],
[
1,
9
],
[
1.5,
8.5
],
[
2,
9.2
],
[
1.3,
8.8
]
],
"k": 3,
"kRange": [
2,
4
],
"standardize": false,
"seed": 42,
"nInit": 10,
"maxIter": 300
}Response exampleJSON
{
"k": 3,
"labels": [
0,
0,
"…"
],
"centroids": [
[
1.425,
1.475
],
[
8.425,
8.5
],
"…"
],
"inertia": 3.12,
"silhouette": 0.888706231706,
"kSelection": [
{
"k": 2,
"inertia": 100.7025,
"silhouette": 0.628401182113
},
{
"k": 3,
"inertia": 3.12,
"silhouette": 0.888706231706
},
"…"
],
"rowsUsed": 12,
"droppedRows": 0,
"caps": {
"maxRows": 50000,
"maxColumns": 100
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Lloyd k-means with k-means++ seeding, nInit restarts, labels renumbered by first appearance.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/kmeans-cluster" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"columns": [
"x",
"y"
],
"rows": [
[
1,
1
],
[
1.5,
2
],
[
2,
1.5
],
[
1.2,
1.4
],
[
8,
8
],
[
8.5,
9
],
[
9,
8.2
],
[
8.2,
8.8
],
[
1,
9
],
[
1.5,
8.5
],
[
2,
9.2
],
[
1.3,
8.8
]
],
"k": 3,
"kRange": [
2,
4
],
"standardize": false,
"seed": 42,
"nInit": 10,
"maxIter": 300
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/dbscan-cluster$0.04 USDCDBSCAN density clustering with noise labels
Density-based clustering with Euclidean or haversine distance, core/border/noise labelling, and an optional k-distance knee suggestion for eps.
Body
| Field | Required | Notes |
|---|---|---|
columns | Yes | array; Array |
rows | Yes | array; Array |
eps | Yes | number |
minSamples | No | integer; Default: 5 |
metric | No | string; One of: euclidean, haversine; Default: "euclidean" |
kDistance | No | boolean; Default: false |
Request exampleJSON
{
"columns": [
"x",
"y"
],
"rows": [
[
1,
1
],
[
1.5,
2
],
[
2,
1.5
],
[
1.2,
1.4
],
[
8,
8
],
[
8.5,
9
],
[
9,
8.2
],
[
8.2,
8.8
],
[
1,
9
],
[
1.5,
8.5
],
[
2,
9.2
],
[
1.3,
8.8
],
[
5,
5
]
],
"eps": 1.5,
"minSamples": 3,
"metric": "euclidean",
"kDistance": false
}Response exampleJSON
{
"labels": [
0,
0,
"…"
],
"clusters": 3,
"noise": 1,
"corePoints": 12,
"kDistance": null,
"rowsUsed": 13,
"droppedRows": 0,
"caps": {
"maxRows": 50000,
"maxColumns": 100
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"DBSCAN (Ester et al. 1996). Border points join the first core cluster reached in row order.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/dbscan-cluster" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"columns": [
"x",
"y"
],
"rows": [
[
1,
1
],
[
1.5,
2
],
[
2,
1.5
],
[
1.2,
1.4
],
[
8,
8
],
[
8.5,
9
],
[
9,
8.2
],
[
8.2,
8.8
],
[
1,
9
],
[
1.5,
8.5
],
[
2,
9.2
],
[
1.3,
8.8
],
[
5,
5
]
],
"eps": 1.5,
"minSamples": 3,
"metric": "euclidean",
"kDistance": false
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/pca$0.03 USDCPrincipal component analysis
Centre (and optionally standardise) columns, decompose the covariance, and return eigenvalues, explained ratios, signed loadings and optional scores.
Body
| Field | Required | Notes |
|---|---|---|
columns | Yes | array; Array |
rows | Yes | array; Array |
standardize | No | boolean; Default: false |
components | No | integer |
returnScores | No | boolean; Default: true |
Request exampleJSON
{
"columns": [
"x",
"y"
],
"rows": [
[
2.5,
2.4
],
[
0.5,
0.7
],
[
2.2,
2.9
],
[
1.9,
2.2
],
[
3.1,
3
],
[
2.3,
2.7
],
[
2,
1.6
],
[
1,
1.1
],
[
1.5,
1.6
],
[
1.1,
0.9
]
],
"standardize": false,
"components": 2,
"returnScores": true
}Response exampleJSON
{
"eigenvalues": [
1.28402771217,
0.0490833989383
],
"explainedRatio": [
0.963181314349,
0.0368186856514
],
"loadings": [
[
0.677873398528,
0.735178655544
],
[
0.735178655544,
-0.677873398528
]
],
"scores": [
[
0.827970186201,
0.175115307047
],
[
-1.77758032528,
-0.142857226544
],
"…"
],
"rowsUsed": 10,
"droppedRows": 0,
"caps": {
"maxRows": 50000,
"maxColumns": 100
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"PCA via spectral decomposition of the covariance (or correlation when standardize=true). Loadings flip so the largest-a…",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/pca" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"columns": [
"x",
"y"
],
"rows": [
[
2.5,
2.4
],
[
0.5,
0.7
],
[
2.2,
2.9
],
[
1.9,
2.2
],
[
3.1,
3
],
[
2.3,
2.7
],
[
2,
1.6
],
[
1,
1.1
],
[
1.5,
1.6
],
[
1.1,
0.9
]
],
"standardize": false,
"components": 2,
"returnScores": true
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/decision-tree-train$0.03 USDCTrain a CART decision tree
Fit a classification or regression CART tree with depth and leaf limits, readable rules, feature importance and optional predictions.
Body
| Field | Required | Notes |
|---|---|---|
task | Yes | string; One of: classification, regression |
columns | Yes | array; Array |
rows | Yes | array; Array |
target | Yes | array; Array |
maxDepth | No | integer; Default: 5 |
minSamplesLeaf | No | integer; Default: 1 |
predict | No | array; Array |
Request exampleJSON
{
"task": "classification",
"columns": [
"age",
"income"
],
"rows": [
[
25,
40
],
[
35,
60
],
[
45,
80
],
[
20,
20
],
[
50,
90
],
[
23,
30
],
[
40,
70
],
[
60,
100
],
[
30,
50
],
[
55,
95
]
],
"target": [
0,
0,
1,
0,
1,
0,
1,
1,
0,
1
],
"maxDepth": 2,
"minSamplesLeaf": 1,
"predict": [
[
33,
66
]
]
}Response exampleJSON
{
"rules": [
"if income <= 65 then 0 (n=5, purity 1)",
"if income > 65 then 1 (n=5, purity 1)"
],
"tree": {
"feature": "income",
"threshold": 65,
"left": {
"value": 0
},
"right": {
"value": 1
}
},
"featureImportance": {
"age": 0,
"income": 1
},
"trainAccuracy": 1,
"predictions": [
1
],
"warnings": [],
"rowsUsed": 10,
"droppedRows": 0,
"caps": {
"maxRows": 50000,
"maxColumns": 100
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"CART with midpoint thresholds, Gini or MSE, ties broken by lower column index then lower threshold.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/decision-tree-train" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"task": "classification",
"columns": [
"age",
"income"
],
"rows": [
[
25,
40
],
[
35,
60
],
[
45,
80
],
[
20,
20
],
[
50,
90
],
[
23,
30
],
[
40,
70
],
[
60,
100
],
[
30,
50
],
[
55,
95
]
],
"target": [
0,
0,
1,
0,
1,
0,
1,
1,
0,
1
],
"maxDepth": 2,
"minSamplesLeaf": 1,
"predict": [
[
33,
66
]
]
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/random-forest-importance$0.05 USDCRandom-forest OOB score and permutation importance
Train a small seeded random forest, report out-of-bag accuracy or R², and estimate permutation feature importance with Fisher-Yates shuffles.
Body
| Field | Required | Notes |
|---|---|---|
task | Yes | string; One of: classification, regression |
columns | Yes | array; Array |
rows | Yes | array; Array |
target | Yes | array; Array |
trees | No | integer; Default: 100 |
maxFeatures | No | Default: "sqrt" |
maxDepth | No | Default: null |
seed | No | integer; Default: 42 |
permutationRepeats | No | integer; Default: 5 |
minSamplesLeaf | No | integer; Default: 1 |
Request exampleJSON
{
"task": "classification",
"columns": [
"signal",
"noise1",
"noise2"
],
"rows": [
[
0,
0,
0
],
[
0.025,
37,
53
],
[
0.05,
74,
9
],
[
0.075,
10,
62
],
[
0.1,
47,
18
],
[
0.125,
84,
71
],
[
0.15,
20,
27
],
[
0.175,
57,
80
],
[
0.2,
94,
36
],
[
0.225,
30,
89
],
[
0.25,
67,
45
],
[
0.275,
3,
1
],
[
0.3,
40,
54
],
[
0.325,
77,
10
],
[
0.35,
13,
63
],
[
0.375,
50,
19
],
[
0.4,
87,
72
],
[
0.425,
23,
28
],
[
0.45,
60,
81
],
[
0.475,
97,
37
],
[
0.5,
33,
90
],
[
0.525,
70,
46
],
[
0.55,
6,
2
],
[
0.575,
43,
55
],
[
0.6,
80,
11
],
[
0.625,
16,
64
],
[
0.65,
53,
20
],
[
0.675,
90,
73
],
[
0.7,
26,
29
],
[
0.725,
63,
82
],
[
0.75,
100,
38
],
[
0.775,
36,
91
],
[
0.8,
73,
47
],
[
0.825,
9,
3
],
[
0.85,
46,
56
],
[
0.875,
83,
12
],
[
0.9,
19,
65
],
[
0.925,
56,
21
],
[
0.95,
93,
74
],
[
0.975,
29,
30
]
],
"target": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"trees": 40,
"maxFeatures": "sqrt",
"maxDepth": null,
"seed": 42,
"permutationRepeats": 2
}Response exampleJSON
{
"oobScore": 0.975,
"importance": [
{
"feature": "signal",
"mean": 0.4125,
"sd": 0.053033008589
},
{
"feature": "noise1",
"mean": 0,
"sd": 0
},
"…"
],
"seed": 42,
"rowsUsed": 40,
"droppedRows": 0,
"caps": {
"maxRows": 50000,
"maxColumns": 100
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Random forest with mulberry32 bootstrap samples and Fisher-Yates permutation importance.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/random-forest-importance" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"task": "classification",
"columns": [
"signal",
"noise1",
"noise2"
],
"rows": [
[
0,
0,
0
],
[
0.025,
37,
53
],
[
0.05,
74,
9
],
[
0.075,
10,
62
],
[
0.1,
47,
18
],
[
0.125,
84,
71
],
[
0.15,
20,
27
],
[
0.175,
57,
80
],
[
0.2,
94,
36
],
[
0.225,
30,
89
],
[
0.25,
67,
45
],
[
0.275,
3,
1
],
[
0.3,
40,
54
],
[
0.325,
77,
10
],
[
0.35,
13,
63
],
[
0.375,
50,
19
],
[
0.4,
87,
72
],
[
0.425,
23,
28
],
[
0.45,
60,
81
],
[
0.475,
97,
37
],
[
0.5,
33,
90
],
[
0.525,
70,
46
],
[
0.55,
6,
2
],
[
0.575,
43,
55
],
[
0.6,
80,
11
],
[
0.625,
16,
64
],
[
0.65,
53,
20
],
[
0.675,
90,
73
],
[
0.7,
26,
29
],
[
0.725,
63,
82
],
[
0.75,
100,
38
],
[
0.775,
36,
91
],
[
0.8,
73,
47
],
[
0.825,
9,
3
],
[
0.85,
46,
56
],
[
0.875,
83,
12
],
[
0.9,
19,
65
],
[
0.925,
56,
21
],
[
0.95,
93,
74
],
[
0.975,
29,
30
]
],
"target": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"trees": 40,
"maxFeatures": "sqrt",
"maxDepth": null,
"seed": 42,
"permutationRepeats": 2
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/kaplan-meier-survival$0.04 USDCKaplan-Meier survival curves and log-rank test
Estimate group Kaplan-Meier curves with Greenwood log-log confidence intervals, median survival, survival at chosen times, and a multi-group log-rank test.
Body
| Field | Required | Notes |
|---|---|---|
subjects | Yes | array; Array |
confidence | No | number; Default: 0.95 |
at | No | array; Array |
Request exampleJSON
{
"subjects": [
{
"time": 6,
"event": 1,
"group": "6-MP"
},
{
"time": 1,
"event": 1,
"group": "placebo"
},
{
"time": 10,
"event": 1,
"group": "6-MP"
},
{
"time": 2,
"event": 1,
"group": "placebo"
},
{
"time": 22,
"event": 1,
"group": "6-MP"
},
{
"time": 8,
"event": 1,
"group": "placebo"
}
],
"confidence": 0.95,
"at": [
10,
22
]
}Response exampleJSON
{
"groups": [
{
"group": "6-MP",
"median": 23,
"survivalAt": [
{
"t": 10,
"S": 0.752941176471
},
{
"t": 13,
"S": 0.690196078431
},
"…"
],
"curve": [
{
"t": 6,
"atRisk": 21,
"events": 3,
"S": 0.857142857143,
"ciLow": 0.619717955266,
"ciHigh": 0.951551747647
},
{
"t": 7,
"atRisk": 17,
"events": 1,
"S": 0.806722689076,
"ciLow": 0.563146564622,
"ciHigh": 0.922809019203
},
"…"
]
},
{
"group": "placebo",
"median": 8,
"survivalAt": [
{
"t": 10,
"S": 0.380952380952
},
{
"t": 13,
"S": 0.190476190476
},
"…"
],
"curve": [
{
"t": 1,
"atRisk": 21,
"events": 2,
"S": 0.904761904762,
"ciLow": 0.670045882235,
"ciHigh": 0.975294149038
},
{
"t": 2,
"atRisk": 19,
"events": 2,
"S": 0.809523809524,
"ciLow": 0.568905059924,
"ciHigh": 0.923888828559
},
"…"
]
}
],
"logRank": {
"chiSquare": 16.7929409892,
"df": 1,
"p": 0.0000416880910933
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Kaplan-Meier with Greenwood variance and log-log confidence intervals; log-rank uses hypergeometric variance.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/kaplan-meier-survival" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"subjects": [
{
"time": 6,
"event": 1,
"group": "6-MP"
},
{
"time": 1,
"event": 1,
"group": "placebo"
},
{
"time": 10,
"event": 1,
"group": "6-MP"
},
{
"time": 2,
"event": 1,
"group": "placebo"
},
{
"time": 22,
"event": 1,
"group": "6-MP"
},
{
"time": 8,
"event": 1,
"group": "placebo"
}
],
"confidence": 0.95,
"at": [
10,
22
]
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/cox-regression$0.05 USDCCox proportional hazards regression
Maximise the Cox partial likelihood with Efron or Breslow ties, return hazard ratios with SEs, concordance, and a rank-time proportional-hazards check.
Body
| Field | Required | Notes |
|---|---|---|
subjects | Yes | array; Array |
ties | No | string; One of: efron, breslow; Default: "efron" |
confidence | No | number; Default: 0.95 |
Request exampleJSON
{
"subjects": [
{
"time": 6,
"event": 1,
"covariates": {
"placebo": 0
}
},
{
"time": 1,
"event": 1,
"covariates": {
"placebo": 1
}
},
{
"time": 10,
"event": 1,
"covariates": {
"placebo": 0
}
},
{
"time": 2,
"event": 1,
"covariates": {
"placebo": 1
}
},
{
"time": 22,
"event": 1,
"covariates": {
"placebo": 0
}
},
{
"time": 8,
"event": 1,
"covariates": {
"placebo": 1
}
}
],
"ties": "efron",
"confidence": 0.95
}Response exampleJSON
{
"coefficients": [
{
"name": "placebo",
"beta": 1.57212515142,
"se": 0.412327391981,
"hazardRatio": 4.81687391074,
"z": 3.81280793368,
"p": 0.000137396883573
}
],
"logLikelihood": -85.0084245774,
"concordance": 0.689801699717,
"phTest": [
{
"name": "placebo",
"chiSquare": 0.0823226487592,
"p": 0.774174160233,
"timeTransform": "rank"
}
],
"converged": true,
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Cox partial likelihood (Efron or Breslow ties) with Newton-Raphson; Grambsch-Therneau PH check vs rank of time.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/cox-regression" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"subjects": [
{
"time": 6,
"event": 1,
"covariates": {
"placebo": 0
}
},
{
"time": 1,
"event": 1,
"covariates": {
"placebo": 1
}
},
{
"time": 10,
"event": 1,
"covariates": {
"placebo": 0
}
},
{
"time": 2,
"event": 1,
"covariates": {
"placebo": 1
}
},
{
"time": 22,
"event": 1,
"covariates": {
"placebo": 0
}
},
{
"time": 8,
"event": 1,
"covariates": {
"placebo": 1
}
}
],
"ties": "efron",
"confidence": 0.95
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/cohort-retention$0.03 USDCCohort retention matrix and weighted curve
Build day/week/month cohort retention in classic or rolling mode from signup and activity dates, with partial-period flags and a size-weighted curve.
Body
| Field | Required | Notes |
|---|---|---|
events | Yes | array; Array |
period | No | string; One of: day, week, month; Default: "month" |
mode | No | string; One of: classic, rolling; Default: "classic" |
asOf | Yes | string |
timezone | No | string; Default: "UTC" |
Request exampleJSON
{
"events": [
{
"userId": "u1",
"signup": "2026-01-05",
"activity": [
"2026-01-05",
"2026-02-10",
"2026-03-02"
]
},
{
"userId": "u2",
"signup": "2026-01-20",
"activity": [
"2026-01-20",
"2026-03-15"
]
},
{
"userId": "u3",
"signup": "2026-01-28",
"activity": [
"2026-01-28"
]
},
{
"userId": "u4",
"signup": "2026-02-03",
"activity": [
"2026-02-03",
"2026-03-04"
]
},
{
"userId": "u5",
"signup": "2026-02-14",
"activity": [
"2026-02-14"
]
}
],
"period": "month",
"mode": "classic",
"asOf": "2026-03-31",
"timezone": "UTC"
}Response exampleJSON
{
"cohorts": [
{
"cohort": "2026-01",
"size": 3,
"retention": [
1,
0.333333333333,
"…"
],
"partial": true
},
{
"cohort": "2026-02",
"size": 2,
"retention": [
1,
0.5
],
"partial": true
}
],
"weightedCurve": [
1,
0.4,
"…"
],
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Cohort retention by signup period; classic counts activity in period k, rolling counts activity in period k or later.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/cohort-retention" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"events": [
{
"userId": "u1",
"signup": "2026-01-05",
"activity": [
"2026-01-05",
"2026-02-10",
"2026-03-02"
]
},
{
"userId": "u2",
"signup": "2026-01-20",
"activity": [
"2026-01-20",
"2026-03-15"
]
},
{
"userId": "u3",
"signup": "2026-01-28",
"activity": [
"2026-01-28"
]
},
{
"userId": "u4",
"signup": "2026-02-03",
"activity": [
"2026-02-03",
"2026-03-04"
]
},
{
"userId": "u5",
"signup": "2026-02-14",
"activity": [
"2026-02-14"
]
}
],
"period": "month",
"mode": "classic",
"asOf": "2026-03-31",
"timezone": "UTC"
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/rfm-segment$0.03 USDCRFM scoring and named customer segments
Score customers 1–bins on recency, frequency and monetary value with average ranks for ties, then map scores to Champions/Loyal/New/At risk/Hibernating or a custom rule list.
Body
| Field | Required | Notes |
|---|---|---|
customers | No | array; Array |
transactions | No | array; Array |
asOf | No | string |
bins | No | integer; Default: 5 |
segmentMap | No | Default: "default" |
Request exampleJSON
{
"customers": [
{
"id": "c1",
"recencyDays": 5,
"frequency": 12,
"monetary": 1200
},
{
"id": "c2",
"recencyDays": 40,
"frequency": 3,
"monetary": 150
},
{
"id": "c3",
"recencyDays": 200,
"frequency": 1,
"monetary": 40
}
],
"bins": 5,
"segmentMap": "default"
}Response exampleJSON
{
"customers": [
{
"id": "c1",
"r": 5,
"f": 5,
"m": 5,
"rfm": "555",
"segment": "Champions"
},
{
"id": "c2",
"r": 3,
"f": 3,
"m": 3,
"rfm": "333",
"segment": "Needs attention"
},
"…"
],
"segments": [
{
"name": "Champions",
"count": 4
},
{
"name": "Needs attention",
"count": 2
},
"…"
],
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"RFM scores use average ranks for ties; default segment map evaluates Champions, Loyal, New, At risk, Hibernating, then …",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/rfm-segment" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"customers": [
{
"id": "c1",
"recencyDays": 5,
"frequency": 12,
"monetary": 1200
},
{
"id": "c2",
"recencyDays": 40,
"frequency": 3,
"monetary": 150
},
{
"id": "c3",
"recencyDays": 200,
"frequency": 1,
"monetary": 40
}
],
"bins": 5,
"segmentMap": "default"
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/clv-bg-nbd$0.05 USDCBG/NBD and Gamma-Gamma customer lifetime value
Fit BG/NBD purchase frequency and Gamma-Gamma spend models, then return P(alive), expected purchases over a horizon, expected value and undiscounted CLV per customer.
Body
| Field | Required | Notes |
|---|---|---|
customers | Yes | array; Array |
horizon | No | number; Default: 10 |
margin | No | number; Default: 1 |
minRepeatCustomers | No | integer; Default: 10 |
Request exampleJSON
{
"customers": [
{
"id": "c0",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c1",
"frequency": 1,
"recency": 3,
"T": 39,
"monetaryValue": 150
},
{
"id": "c2",
"frequency": 2,
"recency": 10,
"T": 39,
"monetaryValue": 35
},
{
"id": "c3",
"frequency": 5,
"recency": 38,
"T": 39,
"monetaryValue": 90
},
{
"id": "c4",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c5",
"frequency": 3,
"recency": 8,
"T": 39,
"monetaryValue": 200
},
{
"id": "c6",
"frequency": 1,
"recency": 30,
"T": 39,
"monetaryValue": 45
},
{
"id": "c7",
"frequency": 4,
"recency": 35,
"T": 39,
"monetaryValue": 60
},
{
"id": "c8",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c9",
"frequency": 2,
"recency": 5,
"T": 39,
"monetaryValue": 25
},
{
"id": "c10",
"frequency": 6,
"recency": 37,
"T": 39,
"monetaryValue": 80
},
{
"id": "c11",
"frequency": 1,
"recency": 2,
"T": 39,
"monetaryValue": 10
},
{
"id": "c12",
"frequency": 3,
"recency": 12,
"T": 39,
"monetaryValue": 20
},
{
"id": "c13",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c14",
"frequency": 7,
"recency": 36,
"T": 39,
"monetaryValue": 35
},
{
"id": "c15",
"frequency": 2,
"recency": 33,
"T": 39,
"monetaryValue": 90
},
{
"id": "c16",
"frequency": 1,
"recency": 15,
"T": 39,
"monetaryValue": 15
},
{
"id": "c17",
"frequency": 4,
"recency": 9,
"T": 39,
"monetaryValue": 200
},
{
"id": "c18",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c19",
"frequency": 5,
"recency": 20,
"T": 39,
"monetaryValue": 60
},
{
"id": "c20",
"frequency": 2,
"recency": 4,
"T": 39,
"monetaryValue": 300
},
{
"id": "c21",
"frequency": 8,
"recency": 38,
"T": 39,
"monetaryValue": 25
},
{
"id": "c22",
"frequency": 1,
"recency": 1,
"T": 39,
"monetaryValue": 80
},
{
"id": "c23",
"frequency": 3,
"recency": 30,
"T": 39,
"monetaryValue": 10
}
],
"horizon": 10,
"margin": 1,
"minRepeatCustomers": 10
}Response exampleJSON
{
"bgnbd": {
"r": 0.966530837691,
"alpha": 6.89967524885,
"a": 5.18424760567,
"b": 20.7911737255,
"logLikelihood": -214.342637155
},
"gammaGamma": {
"p": 1.41882138979,
"q": 2.19572029236,
"v": 75.0459385155
},
"customers": [
{
"id": "c0",
"pAlive": 1,
"expectedPurchases": 0.201992995256,
"expectedValue": null,
"clv": null
},
{
"id": "c1",
"pAlive": 0.164150056375,
"expectedPurchases": 0.0662215810115,
"expectedValue": 122.124651303,
"clv": 8.08728748979
},
"…"
],
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"BG/NBD (Fader, Hardie & Lee 2005) and Gamma-Gamma (Fader & Hardie 2013); CLV is undiscounted expectedPurchases × expect…",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/clv-bg-nbd" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"customers": [
{
"id": "c0",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c1",
"frequency": 1,
"recency": 3,
"T": 39,
"monetaryValue": 150
},
{
"id": "c2",
"frequency": 2,
"recency": 10,
"T": 39,
"monetaryValue": 35
},
{
"id": "c3",
"frequency": 5,
"recency": 38,
"T": 39,
"monetaryValue": 90
},
{
"id": "c4",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c5",
"frequency": 3,
"recency": 8,
"T": 39,
"monetaryValue": 200
},
{
"id": "c6",
"frequency": 1,
"recency": 30,
"T": 39,
"monetaryValue": 45
},
{
"id": "c7",
"frequency": 4,
"recency": 35,
"T": 39,
"monetaryValue": 60
},
{
"id": "c8",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c9",
"frequency": 2,
"recency": 5,
"T": 39,
"monetaryValue": 25
},
{
"id": "c10",
"frequency": 6,
"recency": 37,
"T": 39,
"monetaryValue": 80
},
{
"id": "c11",
"frequency": 1,
"recency": 2,
"T": 39,
"monetaryValue": 10
},
{
"id": "c12",
"frequency": 3,
"recency": 12,
"T": 39,
"monetaryValue": 20
},
{
"id": "c13",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c14",
"frequency": 7,
"recency": 36,
"T": 39,
"monetaryValue": 35
},
{
"id": "c15",
"frequency": 2,
"recency": 33,
"T": 39,
"monetaryValue": 90
},
{
"id": "c16",
"frequency": 1,
"recency": 15,
"T": 39,
"monetaryValue": 15
},
{
"id": "c17",
"frequency": 4,
"recency": 9,
"T": 39,
"monetaryValue": 200
},
{
"id": "c18",
"frequency": 0,
"recency": 0,
"T": 39
},
{
"id": "c19",
"frequency": 5,
"recency": 20,
"T": 39,
"monetaryValue": 60
},
{
"id": "c20",
"frequency": 2,
"recency": 4,
"T": 39,
"monetaryValue": 300
},
{
"id": "c21",
"frequency": 8,
"recency": 38,
"T": 39,
"monetaryValue": 25
},
{
"id": "c22",
"frequency": 1,
"recency": 1,
"T": 39,
"monetaryValue": 80
},
{
"id": "c23",
"frequency": 3,
"recency": 30,
"T": 39,
"monetaryValue": 10
}
],
"horizon": 10,
"margin": 1,
"minRepeatCustomers": 10
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/market-basket-rules$0.04 USDCMarket-basket association rules
Mine frequent itemsets and association rules with support, confidence, lift, leverage and conviction from caller baskets.
Body
| Field | Required | Notes |
|---|---|---|
baskets | Yes | array; Array |
minSupport | No | number; Default: 0.01 |
minConfidence | No | number; Default: 0.5 |
maxItemsetSize | No | integer; Default: 3 |
maxRules | No | integer; Default: 1000 |
Request exampleJSON
{
"baskets": [
[
"bread",
"milk"
],
[
"bread",
"diapers",
"beer",
"eggs"
],
[
"milk",
"diapers",
"beer",
"cola"
],
[
"bread",
"milk",
"diapers",
"beer"
],
[
"bread",
"milk",
"diapers",
"cola"
]
],
"minSupport": 0.4,
"minConfidence": 0.6,
"maxItemsetSize": 3,
"maxRules": 1000
}Response exampleJSON
{
"rules": [
{
"antecedent": [
"cola"
],
"consequent": [
"diapers",
"milk"
],
"support": 0.4,
"confidence": 1,
"lift": 1.66666666667,
"leverage": 0.16,
"conviction": null
},
{
"antecedent": [
"diapers",
"milk"
],
"consequent": [
"cola"
],
"support": 0.4,
"confidence": 0.666666666667,
"lift": 1.66666666667,
"leverage": 0.16,
"conviction": 1.8
},
"…"
],
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Frequent itemsets by level-wise search (Apriori-style) with association rules sorted by lift, confidence, then support.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/market-basket-rules" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"baskets": [
[
"bread",
"milk"
],
[
"bread",
"diapers",
"beer",
"eggs"
],
[
"milk",
"diapers",
"beer",
"cola"
],
[
"bread",
"milk",
"diapers",
"beer"
],
[
"bread",
"milk",
"diapers",
"cola"
]
],
"minSupport": 0.4,
"minConfidence": 0.6,
"maxItemsetSize": 3,
"maxRules": 1000
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/changepoint-detect$0.03 USDCPELT changepoint detection
Detect mean or mean-variance changepoints with PELT, BIC/AIC or custom penalties, and MAD-based noise scaling.
Body
| Field | Required | Notes |
|---|---|---|
values | Yes | array; Array |
model | No | string; One of: mean, meanvar; Default: "mean" |
penalty | No | Default: "bic" |
minSegment | No | integer; Default: 2 |
Request exampleJSON
{
"values": [
1,
1.2,
0.9,
1.1,
1,
0.8,
1.1,
5,
5.2,
4.9,
5.1,
5,
4.8,
5.1,
5.2,
1,
0.9,
1.1,
1,
1.2
],
"model": "mean",
"penalty": "bic",
"minSegment": 2
}Response exampleJSON
{
"changepoints": [
7,
15
],
"segments": [
{
"start": 0,
"end": 7,
"mean": 1.01428571429
},
{
"start": 7,
"end": 15,
"mean": 5.0375
},
"…"
],
"sigma": 0.209671302757,
"penaltyValue": 5.99146454711,
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"PELT changepoint detection (Killick et al. 2012) on mean or mean-variance cost with MAD-based σ.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/changepoint-detect" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"values": [
1,
1.2,
0.9,
1.1,
1,
0.8,
1.1,
5,
5.2,
4.9,
5.1,
5,
4.8,
5.1,
5.2,
1,
0.9,
1.1,
1,
1.2
],
"model": "mean",
"penalty": "bic",
"minSegment": 2
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/classification-metrics$0.02 USDCROC, PR, Brier and calibration metrics
Compute ROC-AUC, average precision, Brier score, confusion at a threshold, Youden-optimal threshold and equal-width calibration bins from binary labels and scores.
Body
| Field | Required | Notes |
|---|---|---|
labels | Yes | array; Array |
scores | Yes | array; Array |
threshold | No | number; Default: 0.5 |
calibrationBins | No | integer; Default: 10 |
Request exampleJSON
{
"labels": [
0,
0,
1,
1,
0,
1,
0,
1,
1,
0
],
"scores": [
0.1,
0.4,
0.35,
0.8,
0.2,
0.9,
0.6,
0.7,
0.55,
0.3
],
"threshold": 0.5,
"calibrationBins": 5
}Response exampleJSON
{
"rocAuc": 0.88,
"prAuc": 0.902857142857,
"brier": 0.1425,
"confusion": {
"threshold": 0.5,
"tp": 4,
"fp": 1,
"fn": 1,
"tn": 4,
"precision": 0.8,
"recall": 0.8,
"f1": 0.8
},
"youdenThreshold": 0.55,
"youdenJ": 0.6,
"calibration": [
{
"bin": [
0,
0.2
],
"meanScore": 0.1,
"fraction": 0,
"n": 1
},
{
"bin": [
0.2,
0.4
],
"meanScore": 0.283333333333,
"fraction": 0.333333333333,
"n": 3
},
"…"
],
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"ROC-AUC is the Mann-Whitney statistic; PR-AUC is average precision; Youden maximises TPR − FPR over unique scores.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/classification-metrics" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"labels": [
0,
0,
1,
1,
0,
1,
0,
1,
1,
0
],
"scores": [
0.1,
0.4,
0.35,
0.8,
0.2,
0.9,
0.6,
0.7,
0.55,
0.3
],
"threshold": 0.5,
"calibrationBins": 5
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/correlation-analysis$0.03 USDCPearson, Spearman, Kendall and partial correlations
Pairwise Pearson/Spearman/Kendall correlations with p-values, optional partial correlations, and Holm/BH/Bonferroni adjustment across pair-method tests.
Body
| Field | Required | Notes |
|---|---|---|
columns | Yes | array; Array |
rows | Yes | array; Array |
methods | No | array; Default: ["pearson"]; Array |
partial | No | array; Array |
adjust | No | string; One of: none, holm, bh, bonferroni; Default: "none" |
Request exampleJSON
{
"columns": [
"x",
"y",
"z"
],
"rows": [
[
1,
2,
1
],
[
2,
1,
1
],
[
3,
4,
2
],
[
4,
3,
2
],
[
5,
7,
3
],
[
6,
8,
3
],
[
7,
6,
4
],
[
8,
9,
4
],
[
9,
10,
5
],
[
10,
12,
5
]
],
"methods": [
"pearson",
"spearman",
"kendall"
],
"partial": [
{
"x": "x",
"y": "y",
"given": [
"z"
]
}
],
"adjust": "holm"
}Response exampleJSON
{
"pairs": [
{
"a": "x",
"b": "y",
"n": 10,
"pearson": {
"r": 0.946314052952,
"p": 0.0000340536228548,
"pAdjusted": 0.000238375359983
},
"spearman": {
"rho": 0.939393939394,
"p": 0.0000548405299851,
"pAdjusted": 0.000305281580213
},
"kendall": {
"tau": 0.822222222222,
"p": 0.000357694003527,
"pAdjusted": 0.0010398580534
}
},
{
"a": "x",
"b": "z",
"n": 10,
"pearson": {
"r": 0.984731927835,
"p": 2.33418632079e-7,
"pAdjusted": 0.00000210076768871
},
"spearman": {
"rho": 0.984731927835,
"p": 2.33418632079e-7,
"pAdjusted": 0.00000210076768871
},
"kendall": {
"tau": 0.942809041582,
"p": 0.000346619351135,
"pAdjusted": 0.0010398580534
}
},
"…"
],
"partial": [
{
"x": "x",
"y": "y",
"given": [
"z"
],
"r": 0.340502612303,
"p": 0.369906747904,
"df": 7
}
],
"rowsUsed": 10,
"caps": {
"maxRows": 50000,
"maxColumns": 100
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Pairwise deletion; Holm/BH/Bonferroni adjust across all pair-method p-values when requested.",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/correlation-analysis" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"columns": [
"x",
"y",
"z"
],
"rows": [
[
1,
2,
1
],
[
2,
1,
1
],
[
3,
4,
2
],
[
4,
3,
2
],
[
5,
7,
3
],
[
6,
8,
3
],
[
7,
6,
4
],
[
8,
9,
4
],
[
9,
10,
5
],
[
10,
12,
5
]
],
"methods": [
"pearson",
"spearman",
"kendall"
],
"partial": [
{
"x": "x",
"y": "y",
"given": [
"z"
]
}
],
"adjust": "holm"
}
JSONhttps://www.brainiac.software/api/v1/predictive-analytics/propensity-score-match$0.04 USDCPropensity-score matching with balance diagnostics
Fit logistic propensity scores, match treated to controls 1:1 on the logit within a caliper, and report SMD balance and common-support counts.
Body
| Field | Required | Notes |
|---|---|---|
units | Yes | array; Array |
caliperSdLogit | No | number; Default: 0.2 |
replacement | No | boolean; Default: false |
order | No | string; One of: descending_score, ascending_score, random; Default: "descending_score" |
seed | No | integer; Default: 42 |
Request exampleJSON
{
"units": [
{
"id": "1",
"treated": 0,
"covariates": {
"age": 25
}
},
{
"id": "2",
"treated": 0,
"covariates": {
"age": 30
}
},
{
"id": "3",
"treated": 0,
"covariates": {
"age": 35
}
},
{
"id": "4",
"treated": 0,
"covariates": {
"age": 40
}
},
{
"id": "5",
"treated": 0,
"covariates": {
"age": 45
}
},
{
"id": "6",
"treated": 0,
"covariates": {
"age": 50
}
},
{
"id": "7",
"treated": 0,
"covariates": {
"age": 55
}
},
{
"id": "8",
"treated": 0,
"covariates": {
"age": 60
}
},
{
"id": "9",
"treated": 1,
"covariates": {
"age": 28
}
},
{
"id": "10",
"treated": 1,
"covariates": {
"age": 33
}
},
{
"id": "11",
"treated": 1,
"covariates": {
"age": 38
}
},
{
"id": "12",
"treated": 1,
"covariates": {
"age": 43
}
},
{
"id": "13",
"treated": 1,
"covariates": {
"age": 48
}
},
{
"id": "14",
"treated": 1,
"covariates": {
"age": 53
}
},
{
"id": "15",
"treated": 1,
"covariates": {
"age": 58
}
},
{
"id": "16",
"treated": 1,
"covariates": {
"age": 63
}
}
],
"caliperSdLogit": 0.2,
"replacement": false,
"order": "descending_score"
}Response exampleJSON
{
"model": {
"intercept": -0.998940067346,
"coefficients": {
"age": 0.0227031833488
}
},
"caliper": 0.054184085363,
"pairs": [
{
"treated": "15",
"control": "8",
"distance": 0.0454063666975
},
{
"treated": "14",
"control": "7",
"distance": 0.0454063666975
},
"…"
],
"unmatchedTreated": [
"16"
],
"balance": [
{
"covariate": "age",
"smdBefore": 0.244948974278,
"smdAfter": -0.185164019955
}
],
"commonSupport": {
"treatedOutside": 1,
"controlOutside": 1
},
"sources": [
{
"source": "Caller-supplied tabular data processed locally",
"url": "https://www.brainiac.software/api/v1/predictive-analytics",
"retrievedAt": "2026-11-14",
"status": "ok"
}
],
"limitations": [
"Propensity scores from logistic regression; 1:1 greedy matching on the logit with a caliper of caliperSdLogit × sd(logi…",
"Outputs are statistical calculations on caller-supplied inputs for human review. They are not legal, medical, credit, t…",
"…"
]
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/predictive-analytics/propensity-score-match" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"units": [
{
"id": "1",
"treated": 0,
"covariates": {
"age": 25
}
},
{
"id": "2",
"treated": 0,
"covariates": {
"age": 30
}
},
{
"id": "3",
"treated": 0,
"covariates": {
"age": 35
}
},
{
"id": "4",
"treated": 0,
"covariates": {
"age": 40
}
},
{
"id": "5",
"treated": 0,
"covariates": {
"age": 45
}
},
{
"id": "6",
"treated": 0,
"covariates": {
"age": 50
}
},
{
"id": "7",
"treated": 0,
"covariates": {
"age": 55
}
},
{
"id": "8",
"treated": 0,
"covariates": {
"age": 60
}
},
{
"id": "9",
"treated": 1,
"covariates": {
"age": 28
}
},
{
"id": "10",
"treated": 1,
"covariates": {
"age": 33
}
},
{
"id": "11",
"treated": 1,
"covariates": {
"age": 38
}
},
{
"id": "12",
"treated": 1,
"covariates": {
"age": 43
}
},
{
"id": "13",
"treated": 1,
"covariates": {
"age": 48
}
},
{
"id": "14",
"treated": 1,
"covariates": {
"age": 53
}
},
{
"id": "15",
"treated": 1,
"covariates": {
"age": 58
}
},
{
"id": "16",
"treated": 1,
"covariates": {
"age": 63
}
}
],
"caliperSdLogit": 0.2,
"replacement": false,
"order": "descending_score"
}
JSON