2020-07-15 21:28:01 +00:00
|
|
|
#if !defined(ARCADIA_BUILD)
|
2020-07-09 10:57:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
|
|
|
#include <algorithm>
|
|
|
|
|
2020-07-17 12:06:29 +00:00
|
|
|
#include <Core/Types.h>
|
|
|
|
#include <Common/PODArray.h>
|
|
|
|
|
2020-07-09 10:57:05 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-07-17 07:23:24 +00:00
|
|
|
typedef struct _Variant
|
2020-07-09 10:57:05 +00:00
|
|
|
{
|
2020-07-23 05:22:18 +00:00
|
|
|
Float64 x;
|
|
|
|
Float64 y;
|
2020-07-17 12:06:29 +00:00
|
|
|
Float64 beats_control;
|
|
|
|
Float64 best;
|
2020-07-17 07:23:24 +00:00
|
|
|
} Variant;
|
|
|
|
|
2020-07-17 12:06:29 +00:00
|
|
|
using Variants = PODArray<Variant>;
|
2020-07-09 10:57:05 +00:00
|
|
|
|
|
|
|
template <bool higher_is_better>
|
2020-07-17 12:06:29 +00:00
|
|
|
Variants bayesian_ab_test(String distribution, PODArray<Float64> & xs, PODArray<Float64> & ys);
|
|
|
|
|
|
|
|
String convertToJson(const PODArray<String> & variant_names, const Variants & variants);
|
2020-07-09 10:57:05 +00:00
|
|
|
|
|
|
|
}
|
2020-07-15 21:28:01 +00:00
|
|
|
#endif
|