You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AttributeError Traceback (most recent call last)
<ipython-input-14-9213dab113d8> in <module>
2 series.plot(label='data')
3 for i, m in enumerate(models):
----> 4 err = mape(backtests[i], series)
5 backtests[i].plot(lw=3, label='{}, MAPE={:.2f}%'.format(m, err))
6 plt.title('Backtests with 3-months forecast horizon')
~/.pyenv/versions/3.8.3/envs/keras/lib/python3.8/site-packages/darts/metrics/metrics.py in wrapper_multivariate_support(*args, **kwargs)
31 series2 = kwargs['series2'] if 'series2' in kwargs else args[0] if 'series1' in kwargs else args[1]
32
---> 33 raise_if_not(series1.width == series2.width, "The two TimeSeries instances must have the same width.", logger)
34
35 num_series_in_args = int('series1' not in kwargs) + int('series2' not in kwargs)
AttributeError: 'numpy.float64' object has no attribute 'width'
To Reproduce
I used this part of the code
from darts.models import Prophet
models = [ExponentialSmoothing(), Prophet()]
backtests = [model.backtest(series,
start=pd.Timestamp('19550101'),
forecast_horizon=3)
for model in models]
from darts.metrics import mape
series.plot(label='data')
for i, m in enumerate(models):
err = mape(backtests[i], series)
backtests[i].plot(lw=3, label='{}, MAPE={:.2f}%'.format(m, err))
plt.title('Backtests with 3-months forecast horizon')
plt.legend()
Expected behavior
I would like to get the article's plot and results.
System (please complete the following information):
u8darts==0.5.0
fbprophet==0.6
Python 3.8.3
Additional context
I don't know if this message is expected but in this part of the code
backtests = [model.backtest(series,
start=pd.Timestamp('19550101'),
forecast_horizon=3)
for model in models]
I get this message many times
INFO:fbprophet:Disabling weekly seasonality. Run prophet with weekly_seasonality=True to override this.
The text was updated successfully, but these errors were encountered:
Hi @juanpabloaj, nice catch! We recently updated the name of the backtest function to historical_forecasts, which is not yet reflected in the medium article. In the meantime you can just replace model.backtest with model.historical_forecasts and that should do the trick!
If you still run into problems please let us know.
When I was trying to follow the article backtests' example
https://medium.com/unit8-machine-learning-publication/darts-time-series-made-easy-in-python-5ac2947a8878
I got this error
To Reproduce
I used this part of the code
Expected behavior
I would like to get the article's plot and results.
System (please complete the following information):
u8darts==0.5.0
fbprophet==0.6
Python 3.8.3
Additional context
I don't know if this message is expected but in this part of the code
I get this message many times
The text was updated successfully, but these errors were encountered: