Te this postbode, deep learning neural networks are applied to the problem of predicting Bitcoin and other cryptocurrency prices. A chartist treatment is taken to predict future values, the network makes predictions based on historical trends te the price and trading volume. A 1D convolutional neural network (CNN) converts an input volume consisting of historical prices from several major cryptocurrencies into future price information.
To facilitate rapid prediction, pricing information is queried using the web API of Poloniex. A URL is provided to the API and a JSON containing the historical price information of a specified cryptocurrency is returned.
After execution, D[i] is a pandas Dataframe containing historical price gegevens for the cryptocurrency cl[i].
Fresh samples are constructed that pair sequences of samples with the subsequent samples. Te this way, a regression prototype can be gezond which predicts time periods into the future given gegevens from the past . A helper class which accomplishes this goes after.
The above class is applied to the original time sequence gegevens to obtain the desired sample and target matrices.
Te the above code, the shapes of and are spil . A holdout period is maintained to access the spectacle of the network. The number of time units ter the period is managed by HP.
The TFANN module is used to create an artificial neural network. TFANN can be installed using pip with the following guideline.
A 1D convolution neural network is constructed which converts the input volume of historical gegevens into predictions. The past NPS samples are transformed into a prediction about the next NFS samples. The C1d option ter the network architecture specification indicates 1-dimensional convolution.
The architecture of the CNN is shown below ter Figure 1. The top set of parenthesized values indicate the filterzakje dimension while the bottom denote the stride.
Figure 1: 1D CNN Architecture
More information and the source code for the ANNR class are available on GitHub.
Using the above network, the next NFS time steps can be predicted. Thesis predictions can ter turn be used for subsequent predictions so that prediction can be made an arbitrary amount into the future. Code to accomplish this goes after.
Using PredictFull, the outputs of intermediate layers te the network can be visualized. Figure Two shows an input sample spil it is transformed by subsequent layers of the network.
Figure Two: Intermediate Layer Outputs
Notice how ter subsequent layers the input gegevens is diminished from NPS to NFS time units.
The result of the predictions can be visualized using matplotlib.
The resulting plot is shown below te Figure Three.