Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ranpy13/bitcoin-prediction

A basic Machine Learning model that predicts the price of Bitcoin.
https://github.com/ranpy13/bitcoin-prediction

Last synced: 6 days ago
JSON representation

A basic Machine Learning model that predicts the price of Bitcoin.

Awesome Lists containing this project

README

        

# bitcoin-prediction
A basic Machine Learning model that predicts the price of Bitcoin.


## About
This project focuses on the prediction of the prices of Bitcoin, the most in-demand crypto-currency of today’s world. We predict the prices accurately by gathering data available at [coinmarketcap](https://web-api.coinmarketcap.com/v1/cryptocurrency/ohlcv/historical?convert=USD&slug=bitcoin&time_end=1601510400&time_start=1367107200) while taking various hyper-parameters into consideration which have affected the bitcoin prices until now.

## Paper presentation
The [paper](9.pdf) contains all details of algorithms used along with results, anaylisis and discussions om the topic.

### Dataset
* [Dataset](https://web-api.coinmarketcap.com/v1/cryptocurrency/ohlcv/historical?convert=USD&slug=bitcoin&time_end=1601510400&time_start=1367107200) has been downloaded using coinmarketcap API.

* Dataset after Preprocessing

![Dataset after preprocessing](imgs/df.png)

* Seasonal Decomposition of the Time-Series after order-1 differencing (to make it stationary)

![Seasonal Decomposition After Order-1 Differencing](imgs/seas-decomp.png)

* Correlation Plots

![Autocorrelation](imgs/corr.png)

* Best Results (GARCH + SARIMAX) (RMSE: 154.32)

![arima-garch-results](imgs/garch-sarimax.png)

### ML Models Used:
* Regression Models
* Linear Regression with various penalties
* Polynomial Regression
* Bayesian Regression
* ARIMA Models
* AR
* ARMA
* ARIMA
* SARIMAX
* SARIMAX + GARCH on the residuals of SARIMAX model
* VAR Model

### Python Dependencies:
* pandas
* numpy
* requests
* matplotlib
* statsmodels
* pmdarima
* arch

### Install Dependencies (requirements.txt)
1. pip install -r requirements.txt

OR

1. ```pipenv install --ignore```
2. ```pipenv shell```
3. ```.\Scripts\activate```

### How to Run
1. ```cd \```
2. ```python \.py```

### File Descriptions:
* `auto-ARIMA.py`: Runs *automated gridsearch* from *pmdarima library*, to find the best model parameters.
* `base-ar.py`, `base-arma.py`, `base-arima.py`, `sarimax.py` use the above found best parameters to train the respective models as per their filenames.
* ```garch-sarimax.py``` runs *sarimax models* added with error of residuals from `SARIMAX` using `GARCH`.
* `elasticnet.py` runs *Linear Regression* with a combination of L1 and L2 penalty.
* `bayesian.py` runs *BayesianRidge regression* with optimal parameters.
* `polyreg.py` runs *Linear Regression* by adding polynomial features.
* `var.py` runs runs *VAR* model on the data.