-
Notifications
You must be signed in to change notification settings - Fork 22
feat(specs): add abtests v3 #4394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
90054e0
docs(abtests) v3 api
Niamsy f09e83e
Update specs/abtesting-v3/common/schemas/Variant.yml
Niamsy af3d013
Update specs/abtesting-v3/common/schemas/Variant.yml
Niamsy 9f41334
Update specs/abtesting-v3/common/schemas/Variant.yml
Niamsy ebb0a58
Update specs/abtesting-v3/paths/abtests.yml
Niamsy 0a7faeb
Update specs/abtesting-v3/paths/scheduleABTest.yml
Niamsy b75ccfe
Update specs/abtesting-v3/paths/estimate.yml
Niamsy 99a31a7
fix(abtests) remove significance from abtest
Niamsy 92286d8
feat(abtests) move filterEffects in metadata + add description to pValue
Niamsy a04ae8c
feat(abtests) add metadata into metric
Niamsy 9ca8fad
doc(abtests) add timeseries endpoint for v3 + add confidence interval…
Niamsy f2b99f0
add confidence interval field descriptions
stevenMevans 6c2f5e2
fix(abtests) traffic percentage min and max + add migratedAbTestID to…
Niamsy b83e6de
feat(abtests) add error correction to get/list endpoint for v3
Niamsy 0bf629d
feat(abtests): Add query params for GET /3/abtests/{id}/timeseries (#…
leonardogavaudan 4cebf3f
Update specs/abtesting-v3/common/schemas/ABTest.yml
leonardogavaudan 5beb7b1
Add filters and errorCorrection to AB test config, remove legacy outl…
leonardogavaudan 77b77ef
Add noResults to list of metrics supported
leonardogavaudan c016091
Merge branch 'main' into docs/abtests/api-v3
shortcuts 2dd5504
chore: validate specs on ci/cli
shortcuts c20a329
add metrics and configuration to the schedule endpoint
leonardogavaudan 0ce4b0c
Fix tests: replace outliers and empty search with metric filters in e…
leonardogavaudan b335034
Merge branch 'main' into docs/abtests/api-v3
shortcuts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# path | ||
ID: | ||
in: path | ||
name: id | ||
description: Unique A/B test identifier. | ||
required: true | ||
schema: | ||
$ref: '#/abTestID' | ||
|
||
# misc | ||
index: | ||
type: string | ||
description: Index name of the A/B test variant (case-sensitive). | ||
example: 'delcourt_production' | ||
|
||
abTestID: | ||
type: integer | ||
description: Unique A/B test identifier. | ||
example: 224 | ||
|
||
abTestScheduleID: | ||
type: integer | ||
description: Unique scheduled A/B test identifier. | ||
example: 224 | ||
|
||
endAt: | ||
type: string | ||
description: End date and time of the A/B test, in RFC 3339 format. | ||
example: 2023-06-17T00:00:00Z | ||
|
||
createdAt: | ||
type: string | ||
description: Date and time when the A/B test was created, in RFC 3339 format. | ||
example: 2023-06-15T15:06:04.249906Z | ||
|
||
updatedAt: | ||
type: string | ||
description: Date and time when the A/B test was last updated, in RFC 3339 format. | ||
example: 2023-06-15T15:06:44.400601Z | ||
|
||
scheduledAt: | ||
type: string | ||
description: Date and time when the A/B test is scheduled to start, in RFC 3339 format. | ||
example: 2023-06-15T15:06:44.400601Z | ||
|
||
name: | ||
type: string | ||
description: A/B test name. | ||
example: Custom ranking sales rank test | ||
|
||
description: | ||
type: string | ||
description: Description for this variant. | ||
example: Current production index | ||
|
||
trafficPercentage: | ||
type: integer | ||
description: Percentage of search requests each variant receives. | ||
minimum: 1 | ||
maximum: 99 | ||
example: 60 | ||
|
||
currencies: | ||
type: object | ||
description: A/B test currencies. | ||
example: | ||
USD: | ||
currency: USD | ||
revenue: 120.0 | ||
mean: 53.7 | ||
standardDeviation: 12.3 | ||
EUR: | ||
currency: EUR | ||
revenue: 100.0 | ||
mean: 43.7 | ||
standardDeviation: 10.3 | ||
additionalProperties: | ||
$ref: '#/currency' | ||
x-additionalPropertiesName: currency code | ||
|
||
currency: | ||
type: object | ||
properties: | ||
currency: | ||
type: string | ||
description: Currency code. | ||
example: 'USD' | ||
revenue: | ||
type: number | ||
format: double | ||
description: Revenue for this currency. | ||
example: 120.0 | ||
mean: | ||
type: number | ||
format: double | ||
description: Mean for this currency. | ||
example: 53.7 | ||
standardDeviation: | ||
type: number | ||
format: double | ||
description: Standard deviation for this currency. | ||
example: 12.3 | ||
|
||
filterEffects: | ||
type: object | ||
description: A/B test filter effects resulting from configuration settings. | ||
properties: | ||
outliers: | ||
title: outliersFilter | ||
type: object | ||
description: Outliers removed from the A/B test as a result of configuration settings. | ||
example: | ||
usersCount: 1 | ||
trackedSearchesCount: 237 | ||
properties: | ||
usersCount: | ||
type: integer | ||
description: Number of users removed from the A/B test. | ||
example: 1 | ||
trackedSearchesCount: | ||
type: integer | ||
description: Number of tracked searches removed from the A/B test. | ||
example: 237 | ||
emptySearch: | ||
title: emptySearchFilter | ||
type: object | ||
description: Empty searches removed from the A/B test as a result of configuration settings. | ||
example: | ||
usersCount: 1 | ||
trackedSearchesCount: 237 | ||
properties: | ||
usersCount: | ||
type: integer | ||
description: Number of users removed from the A/B test. | ||
example: 1 | ||
trackedSearchesCount: | ||
type: integer | ||
description: Number of tracked searches removed from the A/B test. | ||
example: 237 | ||
|
||
metric: | ||
type: object | ||
description: Defines a metric to be retrieved during an A/B test. | ||
properties: | ||
name: | ||
type: string | ||
description: Name of the metric. | ||
dimension: | ||
type: string | ||
description: Dimension of the metric, for example, in case of a revenue metric it could be USD, EUR... | ||
required: | ||
- name | ||
example: | ||
- name: revenue | ||
dimension: USD | ||
- name: conversionRate | ||
- name: clickThroughRate | ||
- name: trackedSearchCount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
ABTests: | ||
oneOf: | ||
- type: array | ||
description: A/B tests. | ||
items: | ||
$ref: '#/ABTest' | ||
- type: 'null' | ||
|
||
ABTest: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
abTestID: | ||
$ref: '../parameters.yml#/abTestID' | ||
updatedAt: | ||
$ref: '../parameters.yml#/updatedAt' | ||
createdAt: | ||
$ref: '../parameters.yml#/createdAt' | ||
endAt: | ||
$ref: '../parameters.yml#/endAt' | ||
name: | ||
$ref: '../parameters.yml#/name' | ||
status: | ||
$ref: '#/Status' | ||
variants: | ||
$ref: 'Variant.yml#/variants' | ||
configuration: | ||
$ref: '#/ABTestConfiguration' | ||
migratedAbTestID: | ||
$ref: '#/MigratedABTestId' | ||
required: | ||
- status | ||
- name | ||
- createdAt | ||
- endAt | ||
- updatedAt | ||
- abTestID | ||
- variants | ||
|
||
Status: | ||
type: string | ||
description: | | ||
A/B test status. | ||
|
||
- `active`. The A/B test is live and search traffic is split between the two variants. | ||
- `stopped`. You stopped the A/B test. The A/B test data is still available for analysis. | ||
- `expired`. The A/B test was automatically stopped after reaching its end date. | ||
- `failed`. Creating the A/B test failed. | ||
example: active | ||
enum: | ||
- active | ||
- stopped | ||
- expired | ||
- failed | ||
|
||
ABTestConfiguration: | ||
title: configuration | ||
type: object | ||
description: A/B test configuration. | ||
properties: | ||
minimumDetectableEffect: | ||
$ref: '#/MinimumDetectableEffect' | ||
filters: | ||
$ref: '#/MetricsFilters' | ||
errorCorrection: | ||
$ref: '#/ErrorCorrectionType' | ||
|
||
MinimumDetectableEffect: | ||
type: object | ||
description: Configuration for the smallest difference between test variants you want to detect. | ||
properties: | ||
size: | ||
type: number | ||
format: double | ||
minimum: 0 | ||
maximum: 1 | ||
description: | | ||
Smallest difference in an observable metric between variants. | ||
For example, to detect a 10% difference between variants, set this value to 0.1. | ||
metric: | ||
$ref: '#/EffectMetric' | ||
required: | ||
- size | ||
- metric | ||
|
||
EffectMetric: | ||
type: string | ||
description: Metric for which you want to detect the smallest relative difference. | ||
enum: | ||
- addToCartRate | ||
- clickThroughRate | ||
- conversionRate | ||
- purchaseRate | ||
- noResultsRate | ||
|
||
MigratedABTestId: | ||
type: integer | ||
description: Unique migrated A/B test identifier. | ||
example: 224 | ||
|
||
MetricsFilter: | ||
type: object | ||
additionalProperties: false | ||
description: | | ||
Boolean filter applied to the A/B test population. Each filter targets a boolean metric | ||
and decides whether to include (true) or exclude (false) matching records. | ||
properties: | ||
domain: | ||
type: string | ||
description: Metric domain (for example `abtesting`, `personalization`). | ||
example: abtesting | ||
name: | ||
type: string | ||
description: Public metric name. | ||
example: isOutlier | ||
trackEffects: | ||
type: boolean | ||
description: Whether the experiment should record the effects of this filter. | ||
includes: | ||
type: boolean | ||
description: If true, keep items that match the filter; if false, exclude them. | ||
required: | ||
- domain | ||
- name | ||
|
||
MetricsFilters: | ||
type: array | ||
description: List of metric filters applied to the test population. | ||
items: | ||
$ref: '#/MetricsFilter' | ||
|
||
ErrorCorrectionType: | ||
type: string | ||
description: Multiple-testing correction method applied when evaluating metric significance. | ||
enum: | ||
- bonferroni | ||
- benjamini-hochberg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ABTestResponse: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
index: | ||
$ref: '../parameters.yml#/index' | ||
abTestID: | ||
$ref: '../parameters.yml#/abTestID' | ||
taskID: | ||
$ref: '../../../common/responses/common.yml#/taskID' | ||
required: | ||
- abTestID | ||
- index | ||
- taskID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
AddABTestsVariant: | ||
oneOf: | ||
- $ref: '#/abTestsVariant' | ||
- $ref: '#/abTestsVariantSearchParams' | ||
|
||
abTestsVariantSearchParams: | ||
allOf: | ||
- $ref: '#/abTestsVariant' | ||
- $ref: '#/customSearchParams' | ||
|
||
abTestsVariant: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
index: | ||
$ref: '../parameters.yml#/index' | ||
trafficPercentage: | ||
$ref: '../parameters.yml#/trafficPercentage' | ||
description: | ||
$ref: '../parameters.yml#/description' | ||
required: | ||
- index | ||
- trafficPercentage | ||
|
||
customSearchParams: | ||
type: object | ||
description: | | ||
Search parameters to add to the test variant. | ||
Only use this parameter if the two variants use the same index. | ||
example: {'typoTolerance': false, 'synonyms': false} | ||
additionalProperties: false | ||
properties: | ||
customSearchParameters: | ||
type: object | ||
required: | ||
- customSearchParameters | ||
x-discriminator-fields: | ||
- customSearchParameters |
18 changes: 18 additions & 0 deletions
18
specs/abtesting-v3/common/schemas/EstimateABTestResponse.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
EstimateABTestResponse: | ||
type: object | ||
properties: | ||
durationDays: | ||
type: integer | ||
format: int64 | ||
description: Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic. | ||
example: 21 | ||
sampleSizes: | ||
type: array | ||
description: | | ||
Sample size estimates for each variant. The first element is the control variant. | ||
Each element is the estimated number of searches required to achieve the desired statistical significance. | ||
items: | ||
type: integer | ||
format: int64 | ||
description: Number of tracked searches needed to be able to detect the configured effect for the control variant. | ||
example: 23415 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ScheduleABTestResponse: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
abTestScheduleID: | ||
$ref: '../parameters.yml#/abTestScheduleID' | ||
required: | ||
- abTestScheduleID |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.