I am working in a Machine Learning Model for Bitcoin Price.

I am attempting to predict how much the price changes in the next day. I am approaching this as a classification problem instead of regression problem because of better results in initial tests.

So i have created a variable called classification which groups the percentage change next day into values of [-4,4]. I am currently grouping it like this:

def percentage_to_classification(x):
    #returns a number y [-4,4] depending on how much it went up/down
    y = 0

    if (x > 0.2):
        y = 4
    elif (0.1 <= x <= 0.2):
        y = 3
    elif (0.05 <= x <= 0.1):
        y = 2
    elif (0.03 <= x <= 0.05):
        y = 1
    elif (-0.03 <= x <= 0.03):
        y = 0
    elif (-0.05 <= x <= -0.03):
        y = -1
    elif (-0.1 <= x <= -0.05):
        y = -2
    elif (-0.2 <= x <= -0.1):
        y = -3
    elif (x < -0.2):
        y = -4

    return y

As it can be seen if the percentage rise is greater than 20%, the output is 4 and so on.

Now over a long time frame the price of bitcoin has increased a lot. From 200 dollars to 20k dollars.

I want to treat a 5% rise at 200 dollar differently than a 5% rise at 10k dollar. More accurately while classifying, I want to take into account the current price along with the percentage change. How can i achieve this?


If you want to incorporate the fact (is it a fact?) that it is different if BTC rises by 10% at a price of 100 USD per BTC than at 10 000 USD per BTC then you could add this information in a proper way in your model as feature/predictor.

You could model in distinct regimes or add indicators of regimes as predictors.

First thoughts that you could add this to your target in the way:

 "% change is x and absolute value/absolute change is y as state K"

lead me to the conclusion that this does not make too much sense.

I think adding it to the predictors is the way to go. But think about the general approach: are there different regimes? Can you model the whole history in one model?

  • $\begingroup$ You are right that whole history cannot be modeled in a single model. I intend to work on some models in shorter time frames. This is one model to capture patterns in long term movements (if they exist). $\endgroup$ – user31078 Jan 25 '18 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy