From 54cd1e7ff2066f194fc0854de0e0a0f9fdb7556b Mon Sep 17 00:00:00 2001 From: Christopher Fonnesbeck Date: Wed, 7 Nov 2018 19:10:47 +0000 Subject: [PATCH] Added imputation warning to model --- pymc3/model.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pymc3/model.py b/pymc3/model.py index 2449d70321..9d705de25a 100644 --- a/pymc3/model.py +++ b/pymc3/model.py @@ -3,6 +3,7 @@ import itertools import threading import six +import warnings import numpy as np from pandas import Series @@ -1259,6 +1260,10 @@ def as_tensor(data, name, model, distribution): data = pandas_to_array(data).astype(dtype) if hasattr(data, 'mask'): + impute_message = ('Data in {name} contains missing values and' + ' will be automatically imputed from the' + ' sampling distribution.'.format(name=name)) + warnings.warn(impute_message, UserWarning) from .distributions import NoDistribution testval = np.broadcast_to(distribution.default(), data.shape)[data.mask] fakedist = NoDistribution.dist(shape=data.mask.sum(), dtype=dtype,