Predictive Analytics using Machine Learning — Crypto Price Prediction
There are mainly five categories under Analytics — Descriptive, Diagnostic, Predictive, Prescriptive, and Cognitive. When we try understanding them in detail, we realize that all of them have their equal importance, but the question arises whether which one can benefit the most to individuals, small scale businesses, and even conglomerate firms. The best answer should be subjective to the category that meets all the requirements and plays a major role from the initial base to the effectiveness of the analytical decisions.
The sole category that stands as the best answer to that is “Predictive Analytics”. The only category that comprises some factors and parts from all the other categories. Whether it is using descriptive analytics to understand the historical data, diagnostic analytics to understand why an event has occurred, and by using certain other techniques involved that are related to statistics or identifying the anomalies in the data, prescriptive analytics to answer which actions are supposed to be taken or cognitive analytics to draw inferences from existing data and pattern.
The primary focus of this project was Time Series Analysis, and how it is derived to predict the future 30-day price of three cryptocurrencies — Bitcoin, Ethereum, and Dogecoin. Apart from that, the other major technique/method applied here is Hyperparameter Tuning where we’ll see how multiple trials take place in a single runtime data prediction project.
As seen above, we can understand that the necessary libraries in python have been imported and the necessary variables have been assigned to calculate and express the date and time matter and how they’ll be considered as data types in the further processes while running the necessary steps to carry out the future price predictions.
We can see that we’ve used the Yfinance library to extract the historical data of Bitcoin, Ethereum, and Dogecoin. The necessary variables have also been assigned mentioning the start date, end date, and the data that needs to be extracted with reference to the price of the crypto(Date, Open, High, Low, Close, Adj Close, Volume), thereby mentioning the index value that needs to be considered.
We can now observe that we were successful in deriving the price values of the crypto and now they can be used for further processes and i.e. where we use machine learning for in-depth analysis and to derive the future values of the crypto. But, to understand that we also need to check the graph/chart of the crypto, and to do that we’ll use the Plotly library to carry out our visualization process as a graph.
In the above process, we imported the Plotly library and then used the necessary values and assigned them as variables to understand the plotted visualization on the basis of the considered factors. In time series, our closing value of the stock is something that is considered of major importance so it is always better to correlate the historical closing data of the stock/crypto, which can be done in the following way:-
Moving ahead to our last and final step of the whole process i.e. forecasting and predicting the future values with the necessary data:-
This is where all our collected data comes into action and gives us the information that we’ve been seeking for so long to get the necessary results. After importing the autoTS library, we then create certain models and modules with whom the data is predicted with a 30-day future closing value. This process may take time as it runs many trials in one single session by using hyperparameter tuning.
Once the trial runtime sessions are over, we get the following results:-
As seen above we can now understand that the help of hyperparameter tuning and time series analysis, which are both a part of machine learning helped us to gather and predict future insights of the stock prices, the accuracy can stretch to 93% of success probability helping us to take meaningful decisions, whether how likely it is good to invest on a short term basis.
Time-series Analysis and hyperparameter tuning can be used in many situations and they reflect effective methods of predictive analytics and play a major role in deriving future predictions and presents the importance of taking decisions on successful majority based probable decisions in many conglomerate areas.
The project repository can be found on my GitHub