Introduction
In this tutorial, we are going to start our new project session on Bitcoin price prediction in machine learning using the linear regression model. This model predicts the price of the Bitcoin on the market basis.
After implement the project, you will learn like :
- How to load data from the GitHub
- how to deal with the correlated features
- How to visualize the data
- How to deal with null values
- Learn how to apply feature scaling
- Error evaluation
Let's start :-
Firstly the basic step is to load all the required libraries and we load the warnings library which is used to deal with the warnings which are generated at the runtime of code execution.
Then Import the data set from GitHub using the database URL and Show the five rows of Bitcoin data set. the data set contains 24 features like btc_market_price, btc_total_bitcoin, btc_trade_volume, btc_market_cap, btc_output_volume etc.Then perform the exploratory data analysis, firstly describe the data to see the minimum, maximum, standard deviation, count values etc.
Now let’s implement a function with name correlation() which takes two parameters, firstly the data and the second one is a threshold value. This function returns all the features which are correlated with our target feature above the threshold value.
When we call this function correlation() it takes data and threshold value and passes a data and 0.81 threshold value, then this function returns all the features which are correlated with the target features above 0.81 threshold value. And display the returned features. You can see in the image below.
Now keep all the features' data which are correlated with our target features in the new data frame and display the new data frame and show the size of the new data frame, as you can see in the picture below.
Then apply the feature scaling which scales the data in a particular range or we can say that apply a normalisation technique to normalise the data.
Then define the linear regression model with default parameters then train a model with training data (X_train and y_train).
Then test tne model using the test data, as you can see in the picture below.
Then evaluate the model that it is performing. Check the mean squared error, root mean squared error and mean absolute error.
Source code
- Go to my GitHub account and download or fork repo : BitCoin Price Prediction
- Then open file using jupyter notebook.



Thanks for sharing such a helpful post! This is a very informative & great Post. I got too much information about crypto heatmap live & updates from this post. Keep Posting!
ReplyDeleteThank You 😊... I'll upload new and interesting post soon
Delete