File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,15 @@ def warnings(self):
67
67
mean_accept = np .mean (accept )
68
68
target_accept = self ._target
69
69
# 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.
71
71
n_bound = min (100 , len (accept ))
72
72
n_good , n_bad = mean_accept * n_bound , (1 - mean_accept ) * n_bound
73
73
lower , upper = stats .beta (n_good + 1 , n_bad + 1 ).interval (0.95 )
74
74
if target_accept < lower or target_accept > upper :
75
75
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."
79
79
)
80
80
info = {"target" : target_accept , "actual" : mean_accept }
81
81
warning = SamplerWarning (WarningType .BAD_ACCEPTANCE , msg , "warn" , extra = info )
You can’t perform that action at this time.
0 commit comments