I am trying to do something like:
trace = pm.backends.text.load('trace')
trace_truncated = trace[start:stop]
but I am getting
ValueError: Stop value in slice not supported.
Any suggestion how to get slice like the one above?
If you refer the source (of PyMC3) you can observe that this error can be avoided only by setting the stop value in the slice to none. It seems for some reason PyMC3 does not support slicing the stop index.
This file has been truncated.
"""Text file trace backend
Store sampling values as CSV files.
Sampling values for each chain are saved in a separate file (under a
directory specified by the `name` argument). The rows correspond to
sampling iterations. The column names consist of variable names and
index labels. For example, the heading
represents two variables, x and y, where x is a scalar and y has a
shape of (3, 2).
from glob import glob
import pandas as pd
I’m very curious to know why isn’t it supported?
@junpenglao any ideas?
Not sure as well. Something to do with the text file format?
We have been planning to improve the trace backend to something more robust for a while now…