Predicting BTC price for the next 30 days by using neural prophet in a simple manner.
Black dots represent reality, and the blue line is the prediction.
Here is the code:
if 'google.colab' in str(get_ipython()):
!pip install neuralprophet
import pandas as pd
df = pd.read_csv("BTC.csv")
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')
from neuralprophet import NeuralProphet, set_log_level
set_log_level("ERROR")
nprophet_model = NeuralProphet(seasonality_mode='multiplicative')
metrics = nprophet_model.fit(df, freq="d")
future_df = nprophet_model.make_future_dataframe(df,
periods = 30,
n_historic_predictions=True)
preds_df_2 = nprophet_model.predict(future_df)
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, and the blue line is the prediction.
Here is the code:
if 'google.colab' in str(get_ipython()):
!pip install neuralprophet
import pandas as pd
df = pd.read_csv("BTC.csv")
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')
from neuralprophet import NeuralProphet, set_log_level
set_log_level("ERROR")
nprophet_model = NeuralProphet(seasonality_mode='multiplicative')
metrics = nprophet_model.fit(df, freq="d")
future_df = nprophet_model.make_future_dataframe(df,
periods = 30,
n_historic_predictions=True)
preds_df_2 = nprophet_model.predict(future_df)
Please share your feedback, especially if you see mistakes in the process.
And remember:
There is always a possibility for error.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.