https://github.com/srj101/future_prediction_facebook_prophet
https://github.com/srj101/future_prediction_facebook_prophet
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/srj101/future_prediction_facebook_prophet
- Owner: srj101
- Created: 2023-07-16T10:12:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-16T10:19:20.000Z (almost 2 years ago)
- Last Synced: 2025-04-22T12:12:59.972Z (17 days ago)
- Language: Jupyter Notebook
- Size: 2.95 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# future_prediction_facebook_prophet
steps to use Prophet and output them in markdown:
Import the necessary libraries and modules:
# Python
import pandas as pd
from prophet import Prophet
Read the data into a pandas DataFrame:
# Python
df = pd.read_csv('example.csv')
Instantiate a Prophet object:
# Python
m = Prophet()
Fit the model with the historical data:
# Python
m.fit(df)
Create a future DataFrame for making predictions:
# Python
future = m.make_future_dataframe(periods=365)
Make predictions using the Prophet model:
# Python
forecast = m.predict(future)
Plot the forecast:
# Python
fig1 = m.plot(forecast)
Plot the forecast components:
# Python
fig2 = m.plot_components(forecast)
Find more details and options in the Prophet documentation.