Predict Bitcoin Prices With Machine Learning And Python [W/Full Code]

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ต.ค. 2024

ความคิดเห็น • 67

  • @DanielGarcia-uq8yz
    @DanielGarcia-uq8yz 2 ปีที่แล้ว +20

    For anyone stuck trying to merge the wiki and btc history data frames, if you get a time-zone error (Cannon merge tz-naive with tz-aware), you will need to edit the datetime index of the btc history data frame after converting it to a datetime object to make it time-zone naive. Here was my fix:
    btc.index = pd.to_datetime(btc.index) [Original Code from Vik]
    btc.index = btx.index.tz_localize(None) [Fix to make index time-zone naive]

    • @adityagavali3158
      @adityagavali3158 ปีที่แล้ว

      eres una leyenda, Muchas Gracias tio

    • @brianmcclain1916
      @brianmcclain1916 9 หลายเดือนก่อน

      is "btx" a typo..you must mean "btc"

  • @atenea3930
    @atenea3930 2 ปีที่แล้ว +8

    For those stuck in cell 7, be aware that one data entry has no comment (20:44, 10 September 2022‎ Staxringold)
    You have to delete that entry with "del revs[x]" being x the position. It depends on when you obtain the data.

    • @Dataquestio
      @Dataquestio  2 ปีที่แล้ว +3

      Thanks for finding the issue! Replacing the line `comment = rev["comment"]` with `comment = rev.get("comment", "")` should also work. This will just fill in the comment with an empty string if it can't be found.

    • @ch-qk8dk
      @ch-qk8dk ปีที่แล้ว

      can you give me the exact code?

    • @atenea3930
      @atenea3930 ปีที่แล้ว

      @@ch-qk8dk the Dataquest's solution is better, it's in my comment

    • @ch-qk8dk
      @ch-qk8dk ปีที่แล้ว

      @@atenea3930 okok thanks

  • @mahmoodhossainfarsim6292
    @mahmoodhossainfarsim6292 2 ปีที่แล้ว +1

    Great one Vik. please keep them coming

  • @user-gu4dt4tn8q
    @user-gu4dt4tn8q ปีที่แล้ว

    Vik, thanks for creating these and sharing your knowledge.

  • @ricebarbie
    @ricebarbie 10 หลายเดือนก่อน

    Thank you for the video. It helped me alot better than my boot camp course.

  • @cacus_
    @cacus_ ปีที่แล้ว +1

    awesome videos! keep it up! have you tried using transformers for timeseries? also, in your experience, what's your opinion on training using technical indicators (let's say RSI, CCI, stochastic, etc) and VIX, rates (could be us 10 years yield for example)?. an idea I'm exploring is trying to figure out how to use also the rolling correlation with a set of assets (let's say you are fiting for QQQ comparing or correlating with dxy, gold or any other asset to check if the rolling correlation impacts in any way)... take care!

  • @sunday-thequant8477
    @sunday-thequant8477 ปีที่แล้ว +1

    are you putting look ahead bias using trend variable, because you sum the target and in the current bar you dont have the bar closed so in real time wont have the trend predictor

  • @pranitchand
    @pranitchand ปีที่แล้ว

    Amazing video. Thank you so much for sharing, I was able to modify it and develop it further to predict the price of Ethereum! Thanks for the inspiration.

    • @Why_interested
      @Why_interested 7 หลายเดือนก่อน

      Can u provide me help regarding final year project on bitcoin price prediction in btech

  • @clusterbyblocks
    @clusterbyblocks 10 หลายเดือนก่อน +2

    Aren't you leaking data by using the Close Value as a predictor? I mean the algorithm just have to look at this to predict next day. Can you reason about it?

  • @ahmetselmanayberkbozkurt6898
    @ahmetselmanayberkbozkurt6898 9 หลายเดือนก่อน

    if you had other variables such as indices, commodity prices would you need to take differences of the variables in order to make the dataset stationary?

  • @atenea3930
    @atenea3930 2 ปีที่แล้ว +3

    I also found that rolling by 15 instead of 30 increases the accuracy in 0.5 points

    • @Theskiescreator
      @Theskiescreator ปีที่แล้ว

      @e7eec37d79c did you manage to get it to work?

  • @merterselcuk
    @merterselcuk 16 วันที่ผ่านมา

    you can use timeseries cross validation technique

  • @it_s_just_me1030
    @it_s_just_me1030 ปีที่แล้ว

    Awesome video, I learned a lot. Thanks!

  • @abhinavab5673
    @abhinavab5673 ปีที่แล้ว +1

    line 56:Cannot join tz-naive with tz-aware DatetimeIndex.Any solution?

  • @ashanbandaranayeke9344
    @ashanbandaranayeke9344 5 หลายเดือนก่อน

    hi! enjoying making this great video, it's the first time I incorporated sentiment analysis at all (in my ML journey). *I'm having a problem with the history attribute/method of yf!* Anyone else?

  • @LXS1121
    @LXS1121 4 หลายเดือนก่อน

    how can we show the predection in 54 rather than 0.54

  • @Who-u9e
    @Who-u9e 2 หลายเดือนก่อน

    i am trying your tutorial in 2024 and yfinance shows that it has no data regarding bitcoin

  • @santoshpatil1029
    @santoshpatil1029 ปีที่แล้ว

    Are you using Jupyter notebook??

  • @wmgallo1
    @wmgallo1 2 ปีที่แล้ว +1

    the mwclient somehow it gives an error

  • @nguyenduyta7136
    @nguyenduyta7136 2 ปีที่แล้ว

    Great sir! Thank so much

  • @ajaychhetri482
    @ajaychhetri482 6 หลายเดือนก่อน

    How much for this project sir ?

  • @chriscoleman1818
    @chriscoleman1818 2 ปีที่แล้ว

    Would/Can you build me one for a certain crypto coin?

  • @nadendlapranaychowdary7703
    @nadendlapranaychowdary7703 6 หลายเดือนก่อน

    Can you send the document of this

  • @kwokcheongyeung665
    @kwokcheongyeung665 2 ปีที่แล้ว

    I can't proceed further in appending (find_sentiment(comment)) to an empty dictionary edit = {}. It keeps loading instead. Can someone help to solve? Thanks!

    • @Dataquestio
      @Dataquestio  2 ปีที่แล้ว

      Hi Kwok - does the find_sentiment function itself work? It may be that the transformers package isn't installed or configured correctly.

  • @fsDragonDKlion3000
    @fsDragonDKlion3000 ปีที่แล้ว

    hello, im trying to run cell 7 and it takes forever to load, i tried the different edits below but it still won't work, is there something else you can advise me to replace it with?

    • @fsDragonDKlion3000
      @fsDragonDKlion3000 ปีที่แล้ว

      just realized that its because it's trying to pass through +17000 comments, other than cutting the data (revs) into less than 1000 records, is there a way to process this any faster?

  • @shivanshyadav1041
    @shivanshyadav1041 9 หลายเดือนก่อน

    you are taking yesterday's closing price as tomorrow's closing price that does not make sense...

  • @munchy5667
    @munchy5667 2 ปีที่แล้ว

    is it possible to make a multi step forcast with classification models such as this?

    • @Dataquestio
      @Dataquestio  2 ปีที่แล้ว

      What is a multi step forecast? Do you mean a forecast multiple days ahead? If so, then yes, just change the .shift(-1) to the number of days ahead you want to predict.

    • @munchy5667
      @munchy5667 2 ปีที่แล้ว

      @@Dataquestio yes forcasting for multiple days ahead. In your video your making a prediction for tommorow. What I wanted was to know if I can make predictions for the next 3 days rather than changing the model with multiple targets

    • @ASH8376
      @ASH8376 ปีที่แล้ว

      @@Dataquestio I changed the shift-1 to shift-5 what does it show me , prediction for next 5 days ?

    • @ASH8376
      @ASH8376 ปีที่แล้ว

      I saw the precision score went up to .70 , what does that mean ?

  • @Sake679
    @Sake679 ปีที่แล้ว

    Hey, mine is not predicting next day

  • @Justme-xg7sl
    @Justme-xg7sl 2 หลายเดือนก่อน

    Thanks

  • @mariajanechan5906
    @mariajanechan5906 ปีที่แล้ว

    Awesome!

  • @aarondelarosa3146
    @aarondelarosa3146 ปีที่แล้ว

    Where's the plot?

  • @yussufolarinde8329
    @yussufolarinde8329 2 ปีที่แล้ว

    Can I try out these codes on pycharm?

    • @Dataquestio
      @Dataquestio  2 ปีที่แล้ว

      Yes, you can use any IDE to complete this project.

  • @dongjunpark7006
    @dongjunpark7006 2 ปีที่แล้ว

    For the line "if len(edits[key]["sentiments"]) > 0:", I got an error saying that "object of type 'float' has no len()" May I kindly ask how to solve this problem?

    • @Dataquestio
      @Dataquestio  2 ปีที่แล้ว

      Hi Dong - the "sentiments" key should be a list, but it looks like it is a single number. This would happen if you assigned the sentiment value directly to the key instead of appending to the list.

  • @dbarbedillo
    @dbarbedillo 2 ปีที่แล้ว +1

    Hi Vik! Hope everything is well! On code cell 7 I keep getting KeyError: 'comment' (The find_sentiment function is working)
    Would really appreciate some help to solve this error :)

    • @Dataquestio
      @Dataquestio  2 ปีที่แล้ว +1

      It looks like calling `page.revisions()` isn't downloading the comment for you for some reason. Try running `page.revisions(prop='ids|timestamp|flags|comment|user')` instead to see if that helps.

    • @dbarbedillo
      @dbarbedillo 2 ปีที่แล้ว

      ​@@Dataquestio Thank you very much! I greatly appreciate your help!

    • @dbarbedillo
      @dbarbedillo 2 ปีที่แล้ว

      Solved the issue the following way: (code cell 7)
      edits = {}
      for rev in revs:
      date = time.strftime("%Y-%m-%d", rev["timestamp"])
      if date not in edits:
      edits[date] = dict(sentiments=list(), edit_count=0)
      edits[date]["edit_count"] += 1
      for k, v in rev.items():
      if k == 'comment':
      comment = v
      edits[date]["sentiments"].append(find_sentiment(comment))

    • @Dataquestio
      @Dataquestio  2 ปีที่แล้ว +1

      That fix looks great. Someone else investigated and found that there is one revision missing the comment key for some reason. This revision is from after I created the original project, so I didn't see it.
      You could also replace the line `comment = rev["comment"]` with `comment = rev.get("comment", "")`. This will just fill in the comment with an empty string if it can't be found.

    • @bryanbuiser2953
      @bryanbuiser2953 ปีที่แล้ว +1

      @@dbarbedillo How long did it take to run that part of the code?

  • @slava9298
    @slava9298 ปีที่แล้ว +1

    also got stuck on cell 7 :( the fixes from the comments don't help

  • @furinfo5158
    @furinfo5158 4 หลายเดือนก่อน +1

    plz dont invest in crypto especialy waqar zaka group or u will be destroying ur life

  • @mytube1000javed
    @mytube1000javed ปีที่แล้ว

    😂ha ha ha. Very funny. Kuch bhi. So u r going to predict the price of Bitcoin. 😅. Very funny. It moves according to whim and fancy of Elon Musk and other big players. Your ML will shamefully fail. So don't even give a try. Anyways great conlmexy😂.

    • @JoaoRodrigues-yf7xc
      @JoaoRodrigues-yf7xc 6 หลายเดือนก่อน

      Mate, you just arrived on a spaceship from Mars and are a little bit lost... The point of this is to learn how to use ML and to code with jupyterlab. It is in no way focused on actually predicting btc moves.