Skip to content

Commit 54cd1e7

Browse files
fonnesbecktwiecki
authored andcommitted
Added imputation warning to model
1 parent cd453bc commit 54cd1e7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pymc3/model.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import itertools
44
import threading
55
import six
6+
import warnings
67

78
import numpy as np
89
from pandas import Series
@@ -1259,6 +1260,10 @@ def as_tensor(data, name, model, distribution):
12591260
data = pandas_to_array(data).astype(dtype)
12601261

12611262
if hasattr(data, 'mask'):
1263+
impute_message = ('Data in {name} contains missing values and'
1264+
' will be automatically imputed from the'
1265+
' sampling distribution.'.format(name=name))
1266+
warnings.warn(impute_message, UserWarning)
12621267
from .distributions import NoDistribution
12631268
testval = np.broadcast_to(distribution.default(), data.shape)[data.mask]
12641269
fakedist = NoDistribution.dist(shape=data.mask.sum(), dtype=dtype,

0 commit comments

Comments
 (0)