Closed halflearned closed 3 years ago
The documentation of function bernoulli_confidence_interval implies that argument num_successes could take real values:
bernoulli_confidence_interval
num_successes
* `num_successes`: number of "successful" Bernoulli trials seen so far, or more generally, sum of observed outcomes.
However, the code seems to allow only integer-valued arguments. In python
y = np.random.uniform(size=100) boundaries.bernoulli_confidence_interval( num_successes=np.sum(y), # Argument is float num_trials=100, alpha=0.1, t_opt=100, alpha_opt=0.1)
leads to this error:
TypeError: bernoulli_confidence_interval(): incompatible function arguments. The following argument types are supported: 1. (num_successes: int, num_trials: int, alpha: float, t_opt: float, alpha_opt: float = 0.05) -> Tuple[float, float] Invoked with: kwargs: num_successes=51.445863688932626, num_trials=100, alpha=0.1, t_opt=100, alpha_opt=0.1
The message disappears if we replace e.g., np.sum(y) by int(np.sum(y)).
np.sum(y)
int(np.sum(y))
The documentation of function
bernoulli_confidence_interval
implies that argumentnum_successes
could take real values:However, the code seems to allow only integer-valued arguments. In python
leads to this error:
The message disappears if we replace e.g.,
np.sum(y)
byint(np.sum(y))
.