Closed
Description
Expected behavior
The code that triggers this issue is self.I(lambda x: x['y_true'].values, self._y_pred, name='y_true')
where len(self._y_pred) == len(self._y_pred['y_true'])
obviously. What I am doing here is showing the plot y with true vs predictions to see the performance of my prediction algos. This was working fine in the previous release so I am reverting back to that for now.
Code sample
self.I(lambda x: x['y_true'].values, self._y_pred, name='y_true')
Actual behavior
I am getting since installing the new 0.6.4 release the following trace:
File "$ENV_HOME/site-packages/backtesting/backtesting.py", line 162, in I
raise ValueError(
ValueError: Indicators must return (optionally a tuple of) numpy.arrays of same length as `data` (data shape: (465,); indicator "y_true" shape: (467,), returned value: [ 0. 0. 1. 0. 0. 0. 0. 0. -1. 0. 0. 0. 0. 0. 0. 0. 1. 0.
1. -1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. -1. 0. 0. 0.
0. 0. 1. 1. 0. 1. -1. 0. 1. 0. 0. 0. 0. 0. 0. 0. 1. 0.
-1. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
1. 0. 1. 0. 0. -1. 0. -1. 0. 0. 0. 0. -1. -1. 1. 0. -1. 0.
0. -1. 0. -1. 0. 0. -1. 0. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. -1. 0. -1. 0. 0. 0. 0.
0. 0. 0. -1. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. -1. 0. 0. -1.
0. 0. 0. 0. 0. -1. 0. 0. -1. 0. 0. 0. 0. 0. 1. 1. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. -1. 0. 0. 0. 0. 0. 0. 0.
0. -1. 0. 0. 0. 0. 0. 0. -1. -1. -1. 0. 0. 0. -1. 1. 0. 0.
1. 1. 0. 1. -1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. -1. 0.
1. 0. 0. 0. 0. 0. -1. -1. 1. 1. 0. 0. 0. -1. 0. 0. 0. 0.
0. 0. -1. 0. 0. -1. 1. 1. -1. 0. 0. -1. 0. 0. 0. -1. 0. 1.
0. 0. 0. 0. 0. 0. 0. 1. 0. 1. 0. 1. 0. 0. 0. 0. 0. -1.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. -1. 0. 0. 0. 0. 0. 0. 1.
0. -1. 0. -1. 1. 1. 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. -1. 0. 0.
1. 0. -1. 0. 0. 0. 1. 0. 0. 1. 1. 0. 0. 1. 1. -1. 0. 0.
-1. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. -1. 0. 1. 0. 0.
0. 0. -1. 0. 0. 0. 0. 0. 0. 0. 0. 0. -1. -1. 0. 0. 0. 0.
0. 1. -1. 0. 0. -1. 0. 0. -1. -1. 1. 1. 0. 0. 0. 0. 1. 0.
0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 0. -1. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 0. 0. 0.])
Additional info, steps to reproduce, full crash traceback, screenshots
No response
Software versions
backtesting.__version__
: 0.6.4pandas.__version__
: 2.2.3numpy.__version__
: 2.1.3bokeh.__version__
: 3.7.0- OS: Linux Thor 6.8.0-60-generic When running GOOG example, no stats table is visible #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Metadata
Metadata
Assignees
Labels
No labels