Predicting ETH price for the next 30 days by using Facebook prophet in a simple manner.
Black dots represent reality, red lines are the changepoints in the trend, and the blue line is the prediction.
Here is the code:
###################
import pandas as pd
from fbprophet import Prophet
df.rename(columns={'Date': 'ds', 'Price (Close)': 'y'}, inplace=True)
df['ds'] = pd.to_datetime(df['ds'], errors='coerce', utc=True )
df['ds'] = df['ds'].dt.strftime('%Y-%m-%d %H:%M')
df.rename(columns={'Date': 'ds', 'Value': 'y'}, inplace=True)
m = Prophet(seasonality_mode='multiplicative')
m.add_seasonality(name='monthly', period=30.5, fourier_order=5)
m.fit(df)
future = m.make_future_dataframe(periods=30*96, freq='15min')
forecast = m.predict(future)
m.plot(forecast)
m.plot_components(forecast)
from fbprophet.plot import add_changepoints_to_plot
fig = m.plot(forecast)
add_changepoints_to_plot(fig.gca(), m, forecast)
plt.show(trend=True)
#################
Please share your feedback, especially if you see mistakes in the process.
And remember:
There is always a possibility for error.
Black dots represent reality, red lines are the changepoints in the trend, and the blue line is the prediction.
Here is the code:
###################
import pandas as pd
from fbprophet import Prophet
df.rename(columns={'Date': 'ds', 'Price (Close)': 'y'}, inplace=True)
df['ds'] = pd.to_datetime(df['ds'], errors='coerce', utc=True )
df['ds'] = df['ds'].dt.strftime('%Y-%m-%d %H:%M')
df.rename(columns={'Date': 'ds', 'Value': 'y'}, inplace=True)
m = Prophet(seasonality_mode='multiplicative')
m.add_seasonality(name='monthly', period=30.5, fourier_order=5)
m.fit(df)
future = m.make_future_dataframe(periods=30*96, freq='15min')
forecast = m.predict(future)
m.plot(forecast)
m.plot_components(forecast)
from fbprophet.plot import add_changepoints_to_plot
fig = m.plot(forecast)
add_changepoints_to_plot(fig.gca(), m, forecast)
plt.show(trend=True)
#################
Please share your feedback, especially if you see mistakes in the process.
And remember:
There is always a possibility for error.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
