ABSynthesis

POST api.scientificmicroservices.com/absynthesis

Analyze and combine results of AB experiments

ABSynthesis takes the results of an experiment or set of experiments and tests for a significant difference between the two groups.

The difference (uplift) between the two groups is returned, along with a value showing how believable the difference is (p-value).

See the full documentation to understand the required input format.

Graph of two distributions made up of different experiments.
Example usage in terminal


curl -H "email:YOUR_EMAIL" \
-H "key:YOUR_KEY" \
-H "Content-Type: application/json" \
--request POST \
--data '[{"successes_base":10,"trials_base":50,"successes_variant":15,"trials_variant":70},
{"successes_base":15,"trials_base":60,"successes_variant":25,"trials_variant":80},
{"successes_base":30,"trials_base":80,"successes_variant":65,"trials_variant":90},
{"successes_base":50,"trials_base":90,"successes_variant":90,"trials_variant":150},
{"successes_base":100,"trials_base":500,"successes_variant":200,"trials_variant":500}]' \
https://api.scientificmicroservices.com/absynthesis

  
> {"uplift":[0.3779],"p_value":[0.0031]}

Use the ABSynthesis API endpoint at api.scientificmicroservices.com/absynthesis to tell me whether there is a difference between the versions of my project. Here is the json of my results: 

[{"successes_base":10,"trials_base":50,"successes_variant":15,"trials_variant":70},{"successes_base":15,"trials_base":60,"successes_variant":25,"trials_variant":80},{"successes_base":30,"trials_base":80,"successes_variant":65,"trials_variant":90},{"successes_base":50,"trials_base":90,"successes_variant":90,"trials_variant":150},{"successes_base":100,"trials_base":500,"successes_variant":200,"trials_variant":500}] 

My key is [YOUR KEY], and the email to use is [YOUR_EMAIL]



import json
import requests

headers = {
    'email': YOUR_EMAIL,
    'key': YOUR_KEY,
    'Content-Type': 'application/json'
}

url_absynthesis = "https://api.scientificmicroservices.com/absynthesis"

successes_base = [10, 15, 30, 50, 100]
trials_base = [50, 60, 80, 90, 500]
sucesses_variant = [15, 25, 65, 90, 200]
trials_variant = [70, 80, 90, 150, 500]

sample_data_ab = [
    {
        "successes_base": sb,
        "trials_base": tb,
        "sucesses_variant": sv,
        "trials_variant": tv
    }
    for sb, tb, sv, tv in zip(successes_base, trials_base, sucesses_variant, trials_variant)
]

response = requests.post(url_absynthesis, headers=headers, json=sample_data_ab)

uplift = response.json()
print(uplift)



library(jsonlite)
library(httr)

url <- "https://api.scientificmicroservices.com/absynthesis"

sample_data <- data.frame(
    "successes_base"= c(10 , 15 , 30 , 50 , 100),
    "trials_base" = c(50 , 60 , 80 , 90 , 500),
    "sucesses_variant" = c(15 , 25,  65,  90, 200),
    "trials_variant" = c(70 , 80 , 90 ,150, 500))

sample_json <- toJSON(sample_data)
response <- POST(
  url = url,
  add_headers(  'email'= YOUR_EMAIL,
                'key' = YOUR_KEY,
                'Content-Type' = 'application/json'
  ),
  body = sample_json,
  encode = "json"
)

uplift <- fromJSON(content(response, as = 'text'))
print(uplift)


Input types allowed
Graphic showing that input types allowed are strings, numbers, single list only
Response fields
uplift The percentage improvement in 'successes' between the two groups
p_value The level to which the uplift value can be trusted, with 0 being completely trustable.