INNER CODE UNIT · Python
imp_values
AnotherSamWilson/miceforest · miceforest/imputation_kernel.py:639
imp_values = np.floor(bachelor_preds + 0.5)
else:
num_bachelors = bachelor_preds.shape[0]
if hashed_seeds is None:
imp_values = random_state.binomial(n=1, p=bachelor_preds)
else:
imp_values = []
for i in range(num_bachelors):
np.random.seed(seed=hashed_seeds[i])
imp_values.append(np.random.binomial(n=1, p=bachelor_preds.iloc[i]))
imp_values = np.array(imp_values)
imp_values.shape = (-1,)
return imp_values