There's a bug in how the MiceImputer implements bayesian methods. Note that both bayesian binary and bayesian least squares suffer from this issue. Essentially, pymc3, the underlying package we leverage for building bayesian models, does not allow you to redefine an existing deterministic variable. autoimpute tries to do that when it iterates through imputations. I will work on a fix for this bug this weekend when I'm tackling another issue.
Here's where that pops up in autoimpute. Both the MultipleImputer and the MiceImputer create nSingleImputer instances under the hood. In the MultipleImputer, each of those n_i instances iterates k=1 time. So if you use a bayesian method, the bayesian model variables are created 1 time for each n instances. Perfectly valid. But for the MiceImputer, each n_1 instances of the SingleImputer iterate k=5 (by default) times. So each instance tries to recreate bayesian variables k times, and that throws an error.
There's a bug in how the
MiceImputer
implements bayesian methods. Note that both bayesian binary and bayesian least squares suffer from this issue. Essentially,pymc3
, the underlying package we leverage for building bayesian models, does not allow you to redefine an existing deterministic variable.autoimpute
tries to do that when it iterates through imputations. I will work on a fix for this bug this weekend when I'm tackling another issue.Here's where that pops up in
autoimpute
. Both theMultipleImputer
and theMiceImputer
createn
SingleImputer
instances under the hood. In theMultipleImputer
, each of thosen_i
instances iteratesk=1
time. So if you use a bayesian method, the bayesian model variables are created 1 time for eachn
instances. Perfectly valid. But for theMiceImputer
, eachn_1
instances of theSingleImputer
iteratek=5
(by default) times. So each instance tries to recreate bayesian variablesk
times, and that throws an error.