Fb Prophet Model Plot : NoneType object is not subscriptable

56 Views Asked by At

I am not able to plot anything in Prophet model when I use the commands such as:

plot1 = m.plot(forecast)
plt2 = m.plot_components(forecast)

I am getting error

NoneType object is not subscriptable

Screenshot of my error

1

There are 1 best solutions below

0
حمزة نبيل On

You did not train your model, here is how we can reproduce the error :

import pandas as pd
from prophet import Prophet
from prophet.plot import plot_plotly


m = Prophet()

# for testing
forecast = pd.DataFrame()

plot_plotly(m, forecast)

To correct that you need to train the model using m.fit(your_data).

Please check the Documentation it contain detailed steps.