Skip to content

Commit

Permalink
std in api response (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
jancervenka authored Apr 4, 2022
1 parent 093c1cd commit ffcac58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ep-stats
version = 1.1.2
version = 1.2.0
description = Statistical package to evaluate ab tests in experimentation platform.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
7 changes: 7 additions & 0 deletions src/epstats/server/res.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class MetricStat(BaseModel):
description="""Nominator and denominator to calculate the mean
are given in metric definition. `mean = nominator / denominator`.""",
)
std: float = Field(
title="Metric Standard Deviation",
)
sum_value: float = Field(
title="Metric Value",
description="""Value of the metric, it is given by the
Expand Down Expand Up @@ -54,6 +57,7 @@ def from_df(df: pd.DataFrame):
exp_variant_id=r["exp_variant_id"],
diff=r["diff"],
mean=r["mean"],
std=r["std"],
sum_value=r["sum_value"],
p_value=r["p_value"],
confidence_interval=r["confidence_interval"],
Expand Down Expand Up @@ -209,6 +213,7 @@ class Config:
"exp_variant_id": "a",
"diff": 0,
"mean": 0.23809523809523808,
"std": 2.1,
"sum_value": 5,
"p_value": 1,
"confidence_interval": 1.1432928868841614,
Expand All @@ -218,6 +223,7 @@ class Config:
"exp_variant_id": "b",
"diff": 0.13076923076923078,
"mean": 0.2692307692307692,
"std": 1.422,
"sum_value": 7,
"p_value": 1,
"confidence_interval": 1.2327467657322932,
Expand All @@ -227,6 +233,7 @@ class Config:
"exp_variant_id": "c",
"diff": 0.26,
"mean": 0.3,
"std": 0.232,
"sum_value": 9,
"p_value": 1,
"confidence_interval": 1.352808784877644,
Expand Down
1 change: 1 addition & 0 deletions tests/epstats/server/test_api_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def assert_experiment(target, test_dao: TestDao, expected_metrics: int, expected
"exp_variant_id": [],
"diff": [],
"mean": [],
"std": [],
"sum_value": [],
"p_value": [],
"confidence_interval": [],
Expand Down

0 comments on commit ffcac58

Please sign in to comment.