text_plain_output_1.png image_output_1.png
from prophet import Prophet

import pandas as pd

import seaborn as sns

df = pd.read_csv('../input/crypto-historical-price/data/BTC-USD.csv')

df.isnull().sum()

df.dropna()

data = df[['Date', 'Adj Close']]
data = data.rename(columns={'Date': 'ds', 'Adj Close': 'y'})

bitcoin_halving = pd.DataFrame({'holiday': 'Bitcoin Halving', 'ds': pd.to_datetime(['2012-11-28', '2016-07-09', '2020-05-11']), 'lower_window': 0, 'upper_window': 1})
holidays = bitcoin_halving

model = Prophet(yearly_seasonality=True, daily_seasonality=True, holidays=holidays)
model.add_country_holidays(country_name='US')
model.fit(data)

future = model.make_future_dataframe(periods=365)
predict = model.predict(future)

model.train_holiday_names

fig = model.plot(predict)

fig = model.plot_components(predict)