np.random.seed(337)sample=arma_sample(n=510,ar=[0.9],ma=[0.0])q=10nma=NeuralMA(q)nma.fit(sample,batch_size=32,nb_epoch=50)score=nma.evaluate()print(score)nma.plot_predictions('fit_ma.png') 浏览完整代码
np.random.seed(137)sample=arma_sample(n=510,ar=[0.9],ma=[0.0])p=10nar=NeuralAR(p)nar.fit(sample,batch_size=32,nb_epoch=50)score=nar.evaluate()print(score)nar.plot_predictions('fit_ar.png') 浏览完整代码来源: