Open marketneutral opened 6 years ago
Solved... this is a Mac OS X issue.
import theano
theano.config.gcc.cxxflags = "-Wno-c++11-narrowing"
or in the install...
export THEANO_FLAGS='gcc.cxxflags=-Wno-c++11-narrowing'
And then it all works .... 🙈
I see a pandas version problem with the Bayesian tearsheet.
Pyfolio requirements are pandas>=0.18.1
and Q zipline stable is built on 0.18.1.
However, the "Alpha Beta Model" calls data_bmark = pd.concat([data, bmark], axis='columns').dropna()
somewhere inside. Pandas 0.18.1 does not support passing the names ['index', 'columns'] for the axis
parameter; it only supports [0,1] in pd.concat
.
Can I make a PR to change that line to data_bmark = pd.concat([data, bmark], axis=1).dropna()
?
Exeception below:
Running alpha beta model
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-05367464daf0> in <module>
2 returns,
3 live_start_date='2017-10-22',
----> 4 benchmark_rets=benchmark
5 )
/anaconda3/envs/env_alphatools_stable/lib/python3.5/site-packages/pyfolio/plotting.py in call_w_context(*args, **kwargs)
50 if set_context:
51 with plotting_context(), axes_style():
---> 52 return func(*args, **kwargs)
53 else:
54 return func(*args, **kwargs)
/anaconda3/envs/env_alphatools_stable/lib/python3.5/site-packages/pyfolio/tears.py in create_bayesian_tear_sheet(returns, benchmark_rets, live_start_date, samples, return_fig, stoch_vol, progressbar)
1273 bmark=benchmark_rets,
1274 samples=samples,
-> 1275 progressbar=progressbar)
1276 previous_time = timer("running alpha beta model", previous_time)
1277
/anaconda3/envs/env_alphatools_stable/lib/python3.5/site-packages/pyfolio/bayesian.py in run_model(model, returns_train, returns_test, bmark, samples, ppc, progressbar)
560 model, trace = model_returns_t_alpha_beta(returns_train,
561 bmark, samples,
--> 562 progressbar=progressbar)
563 elif model == 't':
564 model, trace = model_returns_t(returns_train, samples,
/anaconda3/envs/env_alphatools_stable/lib/python3.5/site-packages/pyfolio/bayesian.py in model_returns_t_alpha_beta(data, bmark, samples, progressbar)
61 """
62
---> 63 data_bmark = pd.concat([data, bmark], axis='columns').dropna()
64
65 with pm.Model() as model:
/anaconda3/envs/env_alphatools_stable/lib/python3.5/site-packages/pandas/tools/merge.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, copy)
843 keys=keys, levels=levels, names=names,
844 verify_integrity=verify_integrity,
--> 845 copy=copy)
846 return op.get_result()
847
/anaconda3/envs/env_alphatools_stable/lib/python3.5/site-packages/pandas/tools/merge.py in __init__(self, objs, axis, join, join_axes, keys, levels, names, ignore_index, verify_integrity, copy)
937
938 self._is_series = isinstance(sample, ABCSeries)
--> 939 if not 0 <= axis <= sample.ndim:
940 raise AssertionError("axis must be between 0 and {0}, "
941 "input was {1}".format(sample.ndim, axis))
TypeError: unorderable types: int() <= str()
I am having trouble running the Bayesian tear sheet. Theano fails with a "Compilation failed (return status=1)". I can make a minimal repro of the exception as follows (I am filing this here and not in the PyMC3 repo b/c pyfolio requires PyMC3==3.1 which is quite old):
I set up the basic environment which is consistent with pyfolio requirements:
Following the most basic example of PyMC3 from the docs:
This gives the lengthly exception:
I can see that the Travis build for python=3.5, pandas=0.18.1 is passing. That's on ubuntu and I am Mac OS X. Do you have any suggestions on this?
pip freeze seems to match that Travis build