Skip to content

Conversation

jsalvatier
Copy link
Member

No description provided.

kyleam and others added 23 commits June 7, 2015 12:40
This has a couple of advantages over the Text backend.

1. The values are stored as in a table per chain, not a file per
   variable.  This is easier to inspect and work with directly if
   desired (e.g., with pd.read_csv).

2. Values are stored during sampling, not kept in memory.
The main reason to keep the Text backend around was that pandas was an
optional dependency.  Now that this is no longer the case, the
original Text backend doesn't offer any advantages over the CSV
backend.  (Even if someone prefers not to write to files while
sampling, they can sample with the NDArray backend and then use the
CSV dump function.)

Rename CSV to Text.  This name is more appropriate because the values
being stored as plain text is the important feature, not which
delimiter is used.
Commit 85b53d4 changed the location of the test sqlite file from
the PWD to /tmp.  (I believe this was because, due to permission
issues, the file was not being removed, and subsequent tests were
failing as a result).

Use tempfile.gettempdir to be more portable.
With the introduction of missing variables it becomes important to be
able to use the value of an ObservedRV. However, this was not possible
because ObservedRV didn't subclass TensorVariable because ObservedRV
could also handle multiple observed arrays so wouldn't always be a
single tensor.

This splits up the two cases into ObservedRV, for single observed
arrays, and MultiObservedRV for multiple observed arrays. ObservedRV
now inherits from TensorVariable.
@jsalvatier
Copy link
Member Author

I'm actually not able to replicate this issue. I have the latest Theano master.

ERROR: pymc3.tests.test_shared.test_deterministic

Traceback (most recent call last):
File "/home/travis/miniconda/envs/testenv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/build/pymc-devs/pymc3/pymc3/tests/test_shared.py", line 14, in test_deterministic
y = pm.Normal('y', 0, 1, observed=X)
File "/home/travis/build/pymc-devs/pymc3/pymc3/distributions/distribution.py", line 19, in new
return model.Var(name, dist, data)
File "/home/travis/build/pymc-devs/pymc3/pymc3/model.py", line 158, in Var
var = ObservedRV(name=name, data=data, distribution=dist, model=self)
File "/home/travis/build/pymc-devs/pymc3/pymc3/model.py", line 410, in init
data = as_tensor(data, name,model,distribution.dtype)
File "/home/travis/build/pymc-devs/pymc3/pymc3/model.py", line 369, in as_tensor
data = pandas_to_array(data).astype(dtype)
ValueError: setting an array element with a sequence.

@jsalvatier
Copy link
Member Author

Managed to replicate.

jsalvatier added a commit that referenced this pull request Jun 7, 2015
Missing values imputation implementation
@jsalvatier jsalvatier merged commit 96e03fc into master Jun 7, 2015
@jsalvatier jsalvatier deleted the missingmaster2 branch June 7, 2015 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants