Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} ,{
"title": "... ci (upper bound)",
"func": lambda x: fnumber(x.mean_diff_ci(self.misc["alpha"])[1]),
"format": self._float_format,
"extended": True,
"popover": ci_popover
}, {
"title": obj.tester.name,
"func": lambda x: x.equal_prob(),
"format": self._percent_format,
"popover": self._popover_for_tester(obj.tester)
}, {
"title": "min n",
"func": lambda x: x.min_observations(),
"format": "{}",
"popover": _Popover(self, "Explanation", """
The minimum of the number of valid runs of both.
or statistically spoken: the minimum sample size.""")
}
]
if not extended:
l = []
for elem in tested_per_prop:
if not ("extended" in elem and elem["extended"]):
l.append(elem)
tested_per_prop = l
def content_func(row_header: str, col_header: str, row: int, col: int):
res = tested_per_prop[row]["func"](obj)
if isinstance(res, str):
return res
return tested_per_prop[row]["format"].format(res)
"popover": _Popover(self, "sdf", "sdf"),
"extended": False
}])
tested_per_prop.extend([{
"title": "max",
"func": lambda x: fnumber(x.max()),
"format": self._float_format,
"popover": _Popover(self, "Explanation", """The maximum value. It's a bad sign if the maximum
is far higher than the mean and you can't explain it.
"""),
"extended": True
}, {
"title": "n",
"func": lambda x: x.observations(),
"format": "{}",
"popover": _Popover(self, "Explanation", """The number of valid runs
or statistically spoken: the sample size."""),
"extended": False
}, {
"title": "mean ci (lower bound)",
"func": lambda x: fnumber(x.mean_ci(self.misc["alpha"])[0]),
"format": self._float_format,
"extended": True,
"popover": mean_ci_popover
} ,{
"title": "mean ci (upper bound)",
"func": lambda x: fnumber(x.mean_ci(self.misc["alpha"])[1]),
"format": self._float_format,
"extended": True,
"popover": mean_ci_popover
}, {
"title": "std dev ci (lower bound)",
extended: bool = False) -> str:
"""
:param objs: objects to look on
:param use_modal: use modals for meta information, not simple links?
:param objs_in_cols: show the different objects in own columns, not rows
:param extended: more infos
:return:
"""
obj_descrs = obj_descrs or [self._obj_description(obj) for obj in objs]
#objs[0]..std_dev_per_mean()
mean_ci_popover = _Popover(self, "Mean confidence interval", """
The chance is \\[ 1 - \\alpha = {p} \\] that the mean lies in the given interval
(assuming the data is normal distributed to a certain degree).
""".format(p=1-self.misc["alpha"]))
std_dev_ci_popover = _Popover(self, "Standard deviation confidence interval", """
The chance is \\[ 1 - \\alpha = {p} \\] that the standard deviation lies in the given interval
(assuming the data is normal distributed to a certain degree).
""".format(p=1-self.misc["alpha"]))
tested_per_prop = [
{
"title": "mean",
"func": lambda x: fnumber(x.mean(), abs_deviation=x.std_dev()),
"format": self._float_format,
"popover": _Popover(self, "Explanation", """
The simple arithmetical mean
\\[ \\frac{1}{n}\\sum_{i=1}^{n} a_i. \\]
""")
}, {
"title": "std dev",
"popover": _Popover(self, "Explanation", """
The sample standard deviation
"title": "sem",
"popover": _Popover(self, "Explanation", """Standard error mean:
\\[ \\sigma(\\overline{X}) = \\frac{\\sigma}{\\sqrt{n}} \\]
<p>Put simply, the standard error of the sample is an estimate of how far the sample mean is
likely to be from the population mean, whereas the standard deviation of the sample is the
degree to which individuals within the sample differ from the sample mean.
(<a href="https://en.wikipedia.org/wiki/Standard_error">wikipedia</a>)</p>""",
trigger="hover focus"),
"func": lambda x: fnumber(x.sem(), abs_deviation=x.sem() / math.sqrt(x.observations())),
"format": self._float_format,
"extended": False
}, {
"title": "median",
"func": lambda x: fnumber(x.median(), abs_deviation=x.std_dev()),
"format": self._float_format,
"popover": _Popover(self, "Explanation", """
The median is the value that seperates that data into two equal sizes subsets
(with the < and the > relation respectively).
As the mean and the standard deviation are already given here, the median isn't important.
"""),
"extended": True
}, {
"title": "min",
"func": lambda x: fnumber(x.min()),
"format": self._float_format,
"popover": _Popover(self, "Explanation", """The minimum value. It's a bad sign if the maximum
is far lower than the mean and you can't explain it.
"""),
"extended": False
}]
if self.misc["min_in_comparison_tables"]:
tested_per_prop.extend([{
def _short_summary_table_for_single_property(self, objs: t.List[SingleProperty], use_modal: bool,
objs_in_cols: bool, obj_descrs: t.List[str] = None,
extended: bool = False) -> str:
"""
:param objs: objects to look on
:param use_modal: use modals for meta information, not simple links?
:param objs_in_cols: show the different objects in own columns, not rows
:param extended: more infos
:return:
"""
obj_descrs = obj_descrs or [self._obj_description(obj) for obj in objs]
#objs[0]..std_dev_per_mean()
mean_ci_popover = _Popover(self, "Mean confidence interval", """
The chance is \\[ 1 - \\alpha = {p} \\] that the mean lies in the given interval
(assuming the data is normal distributed to a certain degree).
""".format(p=1-self.misc["alpha"]))
std_dev_ci_popover = _Popover(self, "Standard deviation confidence interval", """
The chance is \\[ 1 - \\alpha = {p} \\] that the standard deviation lies in the given interval
(assuming the data is normal distributed to a certain degree).
""".format(p=1-self.misc["alpha"]))
tested_per_prop = [
{
"title": "mean",
"func": lambda x: fnumber(x.mean(), abs_deviation=x.std_dev()),
"format": self._float_format,
"popover": _Popover(self, "Explanation", """
The simple arithmetical mean
\\[ \\frac{1}{n}\\sum_{i=1}^{n} a_i. \\]
""")
In statistics, the standard deviation is a measure that is used to quantify the amount of
variation or dispersion of a set of data values. A standard deviation close to 0
indicates that the data points tend to be very close to the mean (also called the
expected value) of the set, while a high standard deviation indicates that the data
points are spread out over a wider range of values.
(<a href="https://en.wikipedia.org/wiki/Standard_deviation">wikipedia</a>)
""", trigger="hover click"),
"func": lambda x: fnumber(x.std_dev(), abs_deviation=x.sem()),
"format": self._float_format,
"extended": True
}, {
"title": r"\(\sigma\) per mean",
"func": lambda x: fnumber(x.std_dev_per_mean(), rel_deviation=x.sem() / (x.mean() ** 2),
is_percent=True),
"format": self._percent_format,
"popover": _Popover(self, "Explanation", """
The standard deviation relative to the mean is a measure of how big the relative variation
of data is. A small value is considered neccessary for a benchmark to be useful.
Or to quote <a href="https://www.cse.unsw.edu.au/~gernot/benchmarking-crimes.html">
Gernot Heiser</a>:
<p>Always do several runs, and check the standard deviation. Watch out for abnormal variance.
In the sort of measurements we do, standard deviations are normally
expected to be less than 0.1%. If you see >1% this should ring alarm bells.</p>
""", trigger="hover click")
}, {
"title": "sem",
"popover": _Popover(self, "Explanation", """Standard error mean:
\\[ \\sigma(\\overline{X}) = \\frac{\\sigma}{\\sqrt{n}} \\]
<p>Put simply, the standard error of the sample is an estimate of how far the sample mean is
likely to be from the population mean, whereas the standard deviation of the sample is the
degree to which individuals within the sample differ from the sample mean.
(<a href="https://en.wikipedia.org/wiki/Standard_error">wikipedia</a>)</p>""",
"""),
"extended": False
}]
if self.misc["min_in_comparison_tables"]:
tested_per_prop.extend([{
"title": r"\(\sigma\) per min",
"func": lambda x: x.std_dev() / x.min(),
"format": self._float_format,
"popover": _Popover(self, "sdf", "sdf"),
"extended": False
}])
tested_per_prop.extend([{
"title": "max",
"func": lambda x: fnumber(x.max()),
"format": self._float_format,
"popover": _Popover(self, "Explanation", """The maximum value. It's a bad sign if the maximum
is far higher than the mean and you can't explain it.
"""),
"extended": True
}, {
"title": "n",
"func": lambda x: x.observations(),
"format": "{}",
"popover": _Popover(self, "Explanation", """The number of valid runs
or statistically spoken: the sample size."""),
"extended": False
}, {
"title": "mean ci (lower bound)",
"func": lambda x: fnumber(x.mean_ci(self.misc["alpha"])[0]),
"format": self._float_format,
"extended": True,
"popover": mean_ci_popover