cohorts
GET
https://lucidace.com /v1/projects/{project_id}/predictive-cohorts Scope cohort:readParameters
project_idstringpathrequiredlimitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/predictive-cohorts"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"data": [
{
"cohort_id": "string",
"created_at": "2024-01-01T00:00:00Z",
"created_by": "string",
"features": [
"string"
],
"goal": "string",
"horizon_days": 0,
"id": "string",
"last_error": "string",
"lookback_days": 0,
"metrics": {},
"model": {},
"model_kind": "string",
"name": "string",
"property_features": [
{}
],
"retrain_every_hours": 0,
"retrain_from": "string",
"scored_count": 0,
"seed": 0,
"selection": {},
"target": "string",
"trained_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"value_property": "string"
}
],
"next_cursor": "string"
}Schema
dataobject[]requiredShow child parameters
cohort_idstringrequiredThe static cohort that holds the scored members.
created_atstringrequiredcreated_bystringfeaturesstring[]requiredEvent names counted as features.
goalstringrequiredGoal event name.
horizon_daysintegerrequiredidstringrequiredlast_errorstringWhy the last scheduled training failed.
lookback_daysintegerrequiredmetricsobjectHoldout
auc, calibration, row counts and base rate of the last training.modelobject{bias, features: [{name, weight, mean, scale}]}: weights are on standardised ln(1 + count).model_kindstringrequiredlinear, or interactions (adds the pairwise products of the features).namestringrequiredproperty_featuresobject[]required[{event, key, value}]: counts of an event where a property has a value, after features.retrain_every_hoursintegerRetrain this often; null = only on request.
retrain_fromstringrequiredThe schedule counts from the last
attempt or the last success.scored_countintegerseedintegerrequiredselectionobjectrequired{"top_k": n} or {"threshold": p}.targetstringrequiredconversion (probability of the goal) or revenue (predicted goal amount, P-M39).trained_atstringupdated_atstringrequiredvalue_propertystringNumeric goal property summed as the amount when
target is revenue.next_cursorstring404
POST
https://lucidace.com /v1/projects/{project_id}/predictive-cohorts Scope cohort:writeParameters
project_idstringpathrequiredRequest body
application/json
featuresstring[]requiredEvent names whose recent counts are the model inputs (1 to 20).
goalstringrequiredThe event to predict.
horizon_daysintegerPredict the goal within this many days (1 to 90, default 7).
lookback_daysintegerDays of history behind each person's counts (1 to 180, default 30).
model_kindstringlinear (default) or interactions: also learns from each pair of features together.namestringrequiredproperty_featuresarray[{event, key, value}]: count event only where property key equals value (at most 20 features with features).retrain_every_hoursintegerRetrain this often (1 to 8760 hours); omit for manual retraining only.
retrain_fromstringThe schedule counts from the last
attempt (default) or the last success.seedintegerSeeds the training sample and holdout split (default 0).
selectionobjectrequired{"top_k": n} (1 to 10000) or {"threshold": p} (0 to 1, exclusive).targetstringconversion (default: probability of the goal) or revenue (predicted goal amount over the horizon, an LTV model; needs value_property). With revenue, a threshold is an amount.value_propertystringNumeric goal-event property holding the amount (for example
revenue), for target: revenue.{
"features": [
"string"
],
"goal": "string",
"horizon_days": 0,
"lookback_days": 0,
"model_kind": "string",
"name": "string",
"property_features": [
{}
],
"retrain_every_hours": 0,
"retrain_from": "string",
"seed": 0,
"selection": {},
"target": "string",
"value_property": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/predictive-cohorts" \
-H "Content-Type: application/json" \
-d '{"features":["string"],"goal":"string","horizon_days":0,"lookback_days":0,"model_kind":"string","name":"string","property_features":[{}],"retrain_every_hours":0,"retrain_from":"string","seed":0,"selection":{},"target":"string","value_property":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201 Trained and scored;
metrics hold the holdout AUC and calibrationExample
{
"cohort_id": "string",
"created_at": "2024-01-01T00:00:00Z",
"created_by": "string",
"features": [
"string"
],
"goal": "string",
"horizon_days": 0,
"id": "string",
"last_error": "string",
"lookback_days": 0,
"metrics": {},
"model": {},
"model_kind": "string",
"name": "string",
"property_features": [
{}
],
"retrain_every_hours": 0,
"retrain_from": "string",
"scored_count": 0,
"seed": 0,
"selection": {},
"target": "string",
"trained_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"value_property": "string"
}Schema
cohort_idstringrequiredThe static cohort that holds the scored members.
created_atstringrequiredcreated_bystringfeaturesstring[]requiredEvent names counted as features.
goalstringrequiredGoal event name.
horizon_daysintegerrequiredidstringrequiredlast_errorstringWhy the last scheduled training failed.
lookback_daysintegerrequiredmetricsobjectHoldout
auc, calibration, row counts and base rate of the last training.modelobject{bias, features: [{name, weight, mean, scale}]}: weights are on standardised ln(1 + count).model_kindstringrequiredlinear, or interactions (adds the pairwise products of the features).namestringrequiredproperty_featuresobject[]required[{event, key, value}]: counts of an event where a property has a value, after features.retrain_every_hoursintegerRetrain this often; null = only on request.
retrain_fromstringrequiredThe schedule counts from the last
attempt or the last success.scored_countintegerseedintegerrequiredselectionobjectrequired{"top_k": n} or {"threshold": p}.targetstringrequiredconversion (probability of the goal) or revenue (predicted goal amount, P-M39).trained_atstringupdated_atstringrequiredvalue_propertystringNumeric goal property summed as the amount when
target is revenue.400
403
404
422 Not enough people who reached the goal to train
503
GET
https://lucidace.com /v1/projects/{project_id}/predictive-cohorts/{id} Scope cohort:readParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/predictive-cohorts/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
model.features lists each input's weight: positive raises the scoreSame as 201 · POST /v1/projects/{project_id}/predictive-cohorts
404
PUT
https://lucidace.com /v1/projects/{project_id}/predictive-cohorts/{id} Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
model_kindstringOmit to keep; used from the next training.
namestringrequiredretrain_every_hoursintegerretrain_fromstringOmit to keep.
selectionobjectrequired{
"model_kind": "string",
"name": "string",
"retrain_every_hours": 0,
"retrain_from": "string",
"selection": {}
}Code samples
cURL
curl -X PUT "https://lucidace.com/v1/projects/{project_id}/predictive-cohorts/{id}" \
-H "Content-Type: application/json" \
-d '{"model_kind":"string","name":"string","retrain_every_hours":0,"retrain_from":"string","selection":{}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
400
403
404
DELETE
https://lucidace.com /v1/projects/{project_id}/predictive-cohorts/{id} Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/predictive-cohorts/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204 Stops retraining; the static cohort stays until deleted
403
404
POST
https://lucidace.com /v1/projects/{project_id}/predictive-cohorts/{id}/retrain Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/predictive-cohorts/{id}/retrain"TypeScript
Python
Go
PHP
Ruby
Java
Updated