lstm回归预测模型
加密货币和神经网络 (Cryptocurrency and Neural Network)
Prediction of stock price is a quite challenging task due to volatile and non-linear nature of the financial stock markets. Here, the problem we have in had is a price prediction issue and we’re trying to predict a numerical value defined in a very large range (from 9000 to 12500 approx). This problem fits the Regression Analysis framework. We shall be using neural networking to try to solve the problem here. Motivation of using neural network is that, it is one of the intelligent data mining techniques that identify a fundamental trend from data and to generalize from it.
股票价格的对 rediction是由于金融证券市场的波动和非线性性质相当具有挑战性的任务。 在这里,我们遇到的问题是价格预测问题,我们试图预测一个很大范围内定义的数值(大约从9000到12500)。 这个问题适合于回归分析框架。 我们将使用神经网络来尝试解决这里的问题。 使用神经网络的动机是,它是从数据中识别出基本趋势并从中进行概括的一种智能数据挖掘技术。
We’ll build a Deep Neural Network here that does some forecasting for us and use it to predict future price. Let us load the hourly frequency data.
宽E“会在这里建立一个深层神经网络,做一些预测为我们,并用它来预测未来的价格。 让我们加载每小时频率数据。
资料载入 (Data loading)
We have a total of 2001 data points representing Bitcoin in USD . We’re interested in predicting the closing price for future dates.
我们总共有2001个数据点代表美元的比特币。 我们有兴趣预测未来日期的收盘价。
When we see a time-series, we always want to know if the value of the current time step affects the next one.
当我们看到一个时间序列时,我们总是想知道当前时间步长的值是否影响下一个时间步长。
plt.figure(figsize = (15,5))
plt.plot(btc.close)
plt.title('BTC Close price (Hourly frequency)')
plt.xlabel ('Date_time')
plt.ylabel ('Price (US$')
plt.show()
We shall use LSTM network here which has the ability to capture long-term dependencies in a sequence (e.g. dependency between today‘s price and that 2 weeks ago). Moreover, uni-variate series is being used here considering only the close price from the series.
我们将在这里使用LSTM网络,该网络具有捕获序列中长期