experiments

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-experiments"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/6af814d4-70c1-4363-8381-689a51668c4d/social-card.svg?v=3e7ae33eec8b" alt="experiments" width="600" height="315"></a>
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/surrogatesScope experiment:write

Parameters

project_idstringpathrequired

Request body

application/json
cohort_eventstringrequired
Event that starts a unit's clock in the training cohort (signup, first purchase, ...).
horizon_daysintegerrequired
namestringrequired
outcome_metric_idstringrequired
ridgenumber
short_daysintegerrequired
surrogate_metric_idsstring[]required
1 to LC_CUPED_MAX_COVARIATES (default 3) metrics.
train_daysinteger
{
  "cohort_event": "string",
  "horizon_days": 0,
  "name": "string",
  "outcome_metric_id": "string",
  "ridge": 0,
  "short_days": 0,
  "surrogate_metric_ids": [
    "string"
  ],
  "train_days": 0
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates" \
  -H "Content-Type: application/json" \
  -d '{"cohort_event":"string","horizon_days":0,"name":"string","outcome_metric_id":"string","ridge":0,"short_days":0,"surrogate_metric_ids":["string"],"train_days":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
Example
{
  "coef": [
    0
  ],
  "cohort_event": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "horizon_days": 0,
  "id": "string",
  "n": 0,
  "name": "string",
  "outcome_metric_id": "string",
  "r2": 0,
  "resid_var": 0,
  "ridge": 0,
  "short_days": 0,
  "surrogate_metric_ids": [
    "string"
  ],
  "train_days": 0,
  "trained_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z"
}
Schema
coefarray
[intercept, b_1, ..., b_k]; null until trained.
cohort_eventstringrequired
created_atstringrequired
created_bystring
horizon_daysintegerrequired
idstringrequired
ninteger
namestringrequired
outcome_metric_idstringrequired
r2number
resid_varnumber
ridgenumberrequired
short_daysintegerrequired
surrogate_metric_idsstring[]required
train_daysintegerrequired
trained_atstring
updated_atstringrequired
400
404
409
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}Scope experiment:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

404
DELETEhttps://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}Scope experiment:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
404
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}/trainScope experiment:write

Fit the model on the cohort whose `cohort_event` fell in the `train_days` before `now - horizon_days`.

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}/train"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
404
503
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/timelineScope experiment:read

Everything that runs in `[from, to)` (default: the last 30 days to 60 days ahead).

Parameters

project_idstringpathrequired
fromstringquery
tostringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/timeline"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "from": "2024-01-01T00:00:00Z",
  "items": [
    {
      "auto_stop": true,
      "end": "2024-01-01T00:00:00Z",
      "id": "string",
      "kind": "string",
      "name": "string",
      "planned_end": "2024-01-01T00:00:00Z",
      "start": "2024-01-01T00:00:00Z",
      "status": "string"
    }
  ],
  "to": "2024-01-01T00:00:00Z"
}
Schema
fromstringrequired
itemsItem[]required
Show child parameters
auto_stopbooleanrequired
The experiment stops itself at planned_end (schedule.auto_stop).
endstring
Actual end; null while running (open-ended).
idstringrequired
kindstringrequired
experiment | guide | flag_schedule.
namestringrequired
planned_endstring
Planned end (schedule.end_at), when one is set.
startstringrequired
statusstringrequired
tostringrequired
400
404
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/traffic-previewScope experiment:read

Pre-launch traffic preview: how many persons a design would enrol per day and per variant, from the last `days` of traffic matching the audience.

Parameters

project_idstringpathrequired

Request body

application/json
audienceFilter[]
Flag-style audience filters; person filters are applied, others are counted in unsupported_filters.
Show child parameters
context_kindstring
user | device | org for context filters (LC-FLG-18).
group_typestring
keystringrequired
opstringrequired
Comparison: eq, neq, contains, ncontains, regex, nregex, gt, gte, lt, lte, is_set, is_not_set, in, not_in, icontains, not_icontains, starts_with, not_starts_with, ends_with, not_ends_with, between, not_between, is_date_before, is_date_after, semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, semver_wildcard, array_contains_any, array_contains_all, array_contains_none, ip_in_cidr, ip_not_in_cidr. event filters take only eq neq gt gte lt lte is_set is_not_set between not_between.
propertiesFilter[]
Predicates on the counted event's own properties (event filters only): only matching events count. Each is {type: "event_property", key, op, value}.
Show child parameters
context_kindstring
user | device | org for context filters (LC-FLG-18).
group_typestring
keystringrequired
opstringrequired
Comparison: eq, neq, contains, ncontains, regex, nregex, gt, gte, lt, lte, is_set, is_not_set, in, not_in, icontains, not_icontains, starts_with, not_starts_with, ends_with, not_ends_with, between, not_between, is_date_before, is_date_after, semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, semver_wildcard, array_contains_any, array_contains_all, array_contains_none, ip_in_cidr, ip_not_in_cidr. event filters take only eq neq gt gte lt lte is_set is_not_set between not_between.
propertiesFilter[]
Predicates on the counted event's own properties (event filters only): only matching events count. Each is {type: "event_property", key, op, value}.
scopestring
session | page for event filters (P-H6): where the event count is taken; empty = session.
typestringrequired
What the key is read from: person, group, cohort, device, geo, app_version, flag, context, event.
valueobject
scopestring
session | page for event filters (P-H6): where the event count is taken; empty = session.
typestringrequired
What the key is read from: person, group, cohort, device, geo, app_version, flag, context, event.
valueobject
daysinteger
Look-back days, 1 to 30 (default 7).
eventstring
Event that marks eligible traffic (default $pageview).
sample_size_per_variantinteger
Sample size per variant to reach; gives days_to_sample.
traffic_pctnumber
Default 100.
variantsPreviewVariant[]
Show child parameters
allocation_pctnumberrequired
keystringrequired
{
  "audience": [
    {
      "context_kind": "string",
      "group_type": "string",
      "key": "string",
      "op": "string",
      "properties": [
        null
      ],
      "scope": "string",
      "type": "string",
      "value": {}
    }
  ],
  "days": 0,
  "event": "string",
  "sample_size_per_variant": 0,
  "traffic_pct": 0,
  "variants": [
    {
      "allocation_pct": 0,
      "key": "string"
    }
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/traffic-preview" \
  -H "Content-Type: application/json" \
  -d '{"audience":[{"context_kind":"string","group_type":"string","key":"string","op":"string","properties":[null],"scope":"string","type":"string","value":{}}],"days":0,"event":"string","sample_size_per_variant":0,"traffic_pct":0,"variants":[{"allocation_pct":0,"key":"string"}]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "avg_daily_persons": 0,
  "daily": [
    {
      "bucket": "string",
      "persons": 0
    }
  ],
  "days_to_sample": 0,
  "eligible_daily_persons": 0,
  "unsupported_filters": 0,
  "variants": [
    {
      "daily_persons": 0,
      "key": "string"
    }
  ]
}
Schema
avg_daily_personsnumberrequired
dailyPreviewDay[]required
Show child parameters
bucketstringrequired
personsnumberrequired
days_to_samplenumber
eligible_daily_personsnumberrequired
unsupported_filtersintegerrequired
variantsPreviewArm[]required
Show child parameters
daily_personsnumberrequired
keystringrequired
400
404
503
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}Scope experiment:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "audience": {},
  "conclusion": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "ended_at": "2024-01-01T00:00:00Z",
  "exposure": {},
  "flag_id": "string",
  "flag_key": "string",
  "guardrail_state": {},
  "holdout_id": "string",
  "hypothesis": "string",
  "id": "string",
  "kind": "string",
  "metrics": {},
  "name": "string",
  "namespace_id": "string",
  "project_id": "string",
  "requires_approval": true,
  "schedule": {},
  "shipped_at": "2024-01-01T00:00:00Z",
  "snapshot": {},
  "started_at": "2024-01-01T00:00:00Z",
  "stats_config": {},
  "status": "string",
  "traffic_pct": 0,
  "updated_at": "2024-01-01T00:00:00Z",
  "variants": {},
  "winner": "string"
}
Schema
audienceobjectrequired
conclusionstring
created_atstringrequired
created_bystring
ended_atstring
exposureobjectrequired
flag_idstringrequired
flag_keystring
Key of the flag flag_id names; null only if that flag row is gone.
guardrail_stateobjectrequired
holdout_idstring
hypothesisstringrequired
idstringrequired
kindstringrequired
metricsobjectrequired
{primary: [metric id], secondary: [...], guardrail: [{metric, direction?}]}.
namestringrequired
namespace_idstring
project_idstringrequired
requires_approvalbooleanrequired
scheduleobjectrequired
shipped_atstring
snapshotobject
started_atstring
stats_configobjectrequired
statusstringrequired
traffic_pctnumberrequired
updated_atstringrequired
variantsobjectrequired
winnerstring
404

Updated