Skip to content

Commit b18a30f

Browse files
stestolltwiecki
authored andcommitted
reduce sigfigs for acceptance probability warning
1 parent 3fb5807 commit b18a30f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pymc3/step_methods/step_sizes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ def warnings(self):
6767
mean_accept = np.mean(accept)
6868
target_accept = self._target
6969
# Try to find a reasonable interval for acceptable acceptance
70-
# probabilities. Finding this was mostry trial and error.
70+
# probabilities. Finding this was mostly trial and error.
7171
n_bound = min(100, len(accept))
7272
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
7373
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
7474
if target_accept < lower or target_accept > upper:
7575
msg = (
76-
"The acceptance probability does not match the target. It "
77-
"is %s, but should be close to %s. Try to increase the "
78-
"number of tuning steps." % (mean_accept, target_accept)
76+
f"The acceptance probability does not match the target. "
77+
f"It is {mean_accept:0.4g}, but should be close to {target_accept:0.4g}. "
78+
f"Try to increase the number of tuning steps."
7979
)
8080
info = {"target": target_accept, "actual": mean_accept}
8181
warning = SamplerWarning(WarningType.BAD_ACCEPTANCE, msg, "warn", extra=info)

0 commit comments

Comments
 (0)