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]
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.
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.
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?
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?
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!
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
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?
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?
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?
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.
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!
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.
@@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
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 :)
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.
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))
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.
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?
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.
😂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😂.
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.