Skip to content

Instantly share code, notes, and snippets.

@krishna1306
Last active August 15, 2024 03:42
Show Gist options
  • Save krishna1306/ddd0c9040f56b65fe62676a27bf41925 to your computer and use it in GitHub Desktop.
Save krishna1306/ddd0c9040f56b65fe62676a27bf41925 to your computer and use it in GitHub Desktop.
Getting started with Prophet
import pandas as pd
from prophet import Prophet
# Initialize the model
m = Prophet()
# you dataframe should have only two columns
# column1 - DateTime object
# column2 - value
df = pd.read_csv('https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv')
df.head()
# Fit the model to your data
m.fit(df)
# Create a dataframe for future predictions
future = m.make_future_dataframe(periods=365)
# Preview the future dataframe
future.tail()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment