# How to Use Facebook Prophet Model

Facebook made FB Prophet, a library for Python and R that lets you make predictions based on time series. There are a lot benefits of using this model and some negative aspects to using this model. So lets explore the pros and cons. Also we will also go through the basic coding of the model.

## What are the Good Things about the Model?

- Ease of use: FB Prophet is made to be easy to use, even for people who don’t know much about forecasting time series.
- Handling of missing data: FB Prophet can deal with missing data in the time series, which is a common problem in time series forecasting.
- Handling holidays: FB Prophet makes it easy to model how holidays affect time series data.
- Good performance: FB Prophet has been shown to do well on a variety of time series forecasting tasks.
- The model allows you to incorporate and understand how holidays affect time series data.

## Some Bad Things about using FB Prophet are:

- It may not work well for all kinds of forecasting problems.
- This is a time-series model so it doesn’t work well for other predictions
- This model is only available in Python and R.
- Limited plot styling
- Doesn’t work with other popular machine learning libraries like Tensorflow, Pytorch, etc., so it doesn’t offer.

## How to Code a Facebook Prophet Model

```
# import the necessary libraries
from fbprophet import Prophet
import pandas as pd
# load the time series data into a pandas dataframe
df = pd.read_csv('user_data.csv')
# specify the columns for the date and the value
df = df.rename(columns={'ds','y'})
# instantiate the Prophet model
model = Prophet()
# fit the model to the data
model.fit(df)
# specify the number of future time points to predict
future_points = 30
# generate future time points
future = model.make_future_dataframe(periods=future_points)
# predict the values for the future time points
forecast = model.predict(future)
# plot the forecast
model.plot(forecast)
```