Meningkatkan model Nabi yang ditafsirkan dengan deep learning
Halo, orang Khabrov. Sebagai bagian dari perekrutan siswa untuk kursus online " Machine Learning. Advanced ", kami menyiapkan terjemahan materi.
Kami mengundang semua orang untuk berpartisipasi dalam pelajaran demo terbuka "Rangkaian Waktu Pengelompokan" : tugas menarik yang dapat dikaitkan dengan deret waktu.
β’ Apakah mungkin menemukan aset keuangan yang mirip satu sama lain dalam dinamika di bursa saham?
β’ Bagaimana cara mengelompokkan pengguna menurut perilakunya?
β’ Siapa yang Membingkai Roger Rabbit?
Kami akan mendapatkan jawaban atas beberapa pertanyaan ini dalam pelajaran online. Bergabunglah dengan kami!
, Prophet, Facebook. , , , , (, ) . , .
, , β NeuralProphet. , Prophet , . , , , Prophet.
, NeuralProphet
. , , . , , . !
NeuralProphet
, NeuralProphet
, , .
β , . , ( ), , . X, . , , , .
, β , , . ββ , - . , , .
Prophet . , , β ββ . β β , . Prophet , :
Prophet β ..
β ,
β . , , . , ( ) . , , .. , . . , :
, ( ), , .
, , ,
, , ( )
, Prophet , , . NeuralProphet
β Prophet, (PyTorch Stan) (AR-Net), . AR-Net , , , , .
NeuralProphet Prophet
NeuralProphet
PyTorch,
.
.
,
( 1).
.
, , -. , , Prophet , , .
, NeuralProphet
β , pip install.
. . .
, Python.
import pandas as pd
from fbprophet import Prophet
from neuralprophet import NeuralProphet
from sklearn.metrics import mean_squared_error
# plotting
import matplotlib.pyplot as plt
# settings
plt.style.use('seaborn')
plt.rcParams["figure.figsize"] = (16, 8)
neural_prophet_1.py hosted with β€ by GitHub
Peyton Manning ( ). , , , , Prophet. β .
Facebook, , Prophet, Prophet, NeuralProphet
.
, :
# loading the dataset
df = pd.read_csv('../neural_prophet/example_data/wp_log_peyton_manning.csv')
print(f'The dataset contains {len(df)} observations.')
df.head()
neural_prophet_2.py hosted with β€ by GitHub
, Prophet, : ds
β /, y
β , . , , .
, . , , . , , .
df.plot(x='ds', y='y', title='Log daily page views');
# getting the train/test split
test_length = 365
df_train = df.iloc[:-test_length]
df_test = df.iloc[-test_length:]
neural_prophet_3.py hosted with β€ by GitHub
Prophet
, Prophet . 4 . . , . , . , Β«future dataframeΒ». , . . , ( ). , preds_df_1
.
prophet_model = Prophet() prophet_model.fit(df_train) future_df = prophet_model.make_future_dataframe(periods=test_length) preds_df_1 = prophet_model.predict(future_df)
neural_prophet_4.py hosted with β€ by GitHub
, ( ).
, . .
. .
prophet_model.plot_components(preds_df_1);
.
NeuralProphet
, API NeuralProphet
Prophet. , , , NeuralProphet
.
nprophet_model = NeuralProphet()
metrics = nprophet_model.fit(df_train, freq="D")
future_df = nprophet_model.make_future_dataframe(df_train,
periods = test_length,
n_historic_predictions=len(df_train))
preds_df_2 = nprophet_model.predict(future_df)
neural_prophet_5.py hosted with β€ by GitHub
, . ( Prophet ) , Β«future dataframeΒ». , .
, , .
nprophet_model.plot(preds_df_2);
. ( , preds_df_2
, preds_df_1
, , , !), .
nprophet_model.plot_components(preds_df_2, residuals=True);
, .
nprophet_model.plot_parameters();
, , plot_components ( ).
, . DataFrame
, (MSE).
# prepping the DataFrame
df_test['prophet'] = preds_df_1.iloc[-test_length:].loc[:, 'yhat']
df_test['neural_prophet'] = preds_df_2.iloc[-test_length:].loc[:, 'yhat1']
df_test.set_index('ds', inplace=True)
print('MSE comparison ----')
print(f"Prophet:\t{mean_squared_error(df_test['y'], preds_df_1.iloc[-test_length:]['yhat']):.4f}")
print(f"NeuralProphet:\t{mean_squared_error(df_test['y'], preds_df_2.iloc[-test_length:]['yhat1']):.4f}")
df_test.plot(title='Forecast evaluation');
neural_prophet_6.py hosted with β€ by GitHub
.
, , MSE β NeuralProphet
.
, , . , , , , , , . . . .
NeuralProphet
β ( -), . , . Prophet, , , , .
Prophet NeuralProphet
, , , . , !
, , GitHub. , . .