时间序列分析 bprophet 画图提示:float() argument must be a string or a number 的解决方法

参考:https://github.com/facebook/prophet/issues/999

使用 fbprophet 预测时间序列模型绘制预测数据时,得到如下错误:
TypeError: float() argument must be a string or a number, not 'datetime.datetime'

from fbprophet import Prophet
model_prophet = Prophet(interval_width=0.95, holidays=holidays)
forecast = model_prophet.predict(future_dates)

model_prophet.plot(forecast)

解决方法如下:
plot 方法之前,加一句:pd.plotting.register_matplotlib_converters()

pd.plotting.register_matplotlib_converters()
model_prophet.plot(forecast)

你可能感兴趣的:(机器学习)