Time Series Forecasting with XGBoost - Use python and machine learning to predict energy consumption

  Рет қаралды 369,969

Rob Mulla

Rob Mulla

Күн бұрын

In this video tutorial we walk through a time series forecasting example in python using a machine learning model XGBoost to predict energy consumption with python. We walk through this project in a kaggle notebook (linke below) that you can copy and explore while watching.
Notebook used in this video: www.kaggle.com/code/robikscub...
Timeline:
00:00 Intro
03:15 Data prep
08:24 Feature creation
12:05 Model
15:35 Feature Importance
17:33 Forecast
Follow me on twitch for live coding streams: / medallionstallion_
My other videos:
Speed Up Your Pandas Code: • Make Your Pandas Code ...
Speed up Pandas Code: • Make Your Pandas Code ...
Intro to Pandas video: • A Gentle Introduction ...
Exploratory Data Analysis Video: • Exploratory Data Analy...
Working with Audio data in Python: • Audio Data Processing ...
Efficient Pandas Dataframes: • Speed Up Your Pandas D...
* KZbin: youtube.com/@robmulla?sub_con...
* Discord: / discord
* Twitch: / medallionstallion_
* Twitter: / rob_mulla
* Kaggle: www.kaggle.com/robikscube
#xgboost #python #machinelearning

Пікірлер: 403
@casperj4784
@casperj4784 Жыл бұрын
A comprehensive yet succinct tutorial. And, having only just finished my Data Science degree, I found it very reassuring to see that you do get faster and more proficient with time.
@robmulla
@robmulla Жыл бұрын
I absolutely love messages like this. Glad to hear you found this helpful and it gave you the reassurment that things get faster. I can tell you that they do! The goal of my channel is to "spark curiosity in data science" I hope this video did that for you.
@RaviKumar-uf3eo
@RaviKumar-uf3eo Жыл бұрын
Yes. It is very reassuring, but most probably he would have kept all the things ready.
@amirghorbani7922
@amirghorbani7922 5 ай бұрын
It is better to use icdst Ai predict lstm model.
@karishmakapoor4285
@karishmakapoor4285 Жыл бұрын
Amazing flow, comprehensive yet smooth. Detailed yet generic. I love the way you think and your float across the entire process. I did this project myself and thoroughly enjoyed it. Cant wait to apply this to other datasets. A Big thumps up👍
@naderbazyari2
@naderbazyari2 2 ай бұрын
Second time watching this and doing every step on my notebook as Rob goes through the task. I am still blown away by the intricacy of his approach and how he investigates the case. fascinating how he makes it look effortless. Many thanks
@sevenaac4783
@sevenaac4783 Ай бұрын
Thank you for teaching me. It allows me to understand the time series XGBoost in the shortest time.
@flel2514
@flel2514 Жыл бұрын
Hi Rob, I am a fresh data science graduate, and I find this tutorial very well done and very helpful for those that approach TS for the first time as well as for those that want to refresh the topic
@rodolfoviegas8504
@rodolfoviegas8504 11 ай бұрын
Amazing. We've learnt time series prediction only by statistical methods and/or making ML models to act like ARIMA - making lags for feed them. This approuch very interesting and intuitive. Thanks, Rob
@beckynevin1
@beckynevin1 3 ай бұрын
Wow! I'm trying to get up to speed on XGBoost, so I clicked on this video. There are a lot of meh data science tutorials out there, so it was such a treat to come across this one after slogging through youtube. I immediately subscribed and am headed to your channel to watch more videos on time series prediction!
@luismisanmartin98
@luismisanmartin98 7 күн бұрын
As someone just getting introduced to time series analysis, this video was gold, thank you for making it!
@musicplace9205
@musicplace9205 4 ай бұрын
Thanks! one of the best video I've ever seen. Simple, clear and overall why each concept is used for.
@jelc
@jelc Жыл бұрын
Really well focused and clearly explained. Love your work!
@robmulla
@robmulla Жыл бұрын
I appreciate the feedback Julian
@MilChamp1
@MilChamp1 Жыл бұрын
This was a very nice introduction to this topic. You might consider turning this into a miniseries, since it's such a large topic; the next video might be on how to create the best cross-validation splits for timeseries
@robmulla
@robmulla Жыл бұрын
Thanks so much. There is so much to cover with time series. I may consider a miniseries that’s a great idea. I’d like to make one on prophet which is a great package for time series forecasting too.
@zhuoningli
@zhuoningli Жыл бұрын
Hi Rob! Your tutorials help me get a job offer! When I was searching for a job, I received a take-home technical exercise about time series forecasting. I watched this video and finished my exercise. Finally, I got my dream job! Thank you so much!!! I really appreciate your tutorials! 🥰
@robmulla
@robmulla Жыл бұрын
Whoa, I really love hearing stories like this. That's amazing and I wish you the best in the rest of your career.
@hussamcheema
@hussamcheema Жыл бұрын
I love your content. Liked the video before watching it because I know this is gonna be a great tutorial. Thanks for making these tutorials. 😊
@robmulla
@robmulla Жыл бұрын
Thanks! Glad you find it helpful.
@JacksonWelch
@JacksonWelch Жыл бұрын
Love these videos. As a data engineer I love seeing other peoples workflows. Thanks so much for posting.
@robmulla
@robmulla Жыл бұрын
Glad you liked it. Thanks for watching Jackson.
@ADaBaker95
@ADaBaker95 7 ай бұрын
Best video on the subject I've found so far!
@fudgenuggets405
@fudgenuggets405 Жыл бұрын
I like this dude's videos. They are informative and to the point.
@Singularitarian
@Singularitarian Жыл бұрын
Very illuminating! Learned a whole lot in just 23 minutes.
@NotesandPens-ro9wx
@NotesandPens-ro9wx 5 ай бұрын
Man I am seeing this after an year and your teaching style is just hell .. now sub done and will follow you on other things :) for sure
@nirbhay_raghav
@nirbhay_raghav Жыл бұрын
Hands down, the bestest (if that is a word) video on the entire internet about implementation. No fancy stuff. Not too beginner and toy examples. Hust the right thing what a budding data scientist needs to see. And it is definitely reassuring to see that one can really get better and faster at doing these after a while. It takes me a lot of time reach what you have done in under 30min. Debugging things take a lot of time.
@robmulla
@robmulla Жыл бұрын
I really apprecaite your positive feedback! Glad to hear you find it encouraging that eventually things will get faster.
@22niloc
@22niloc 10 ай бұрын
I'm getting to know Time Series and your vid has loads of great starter points.
@troy_neilson
@troy_neilson Жыл бұрын
Informative and well-structured. Thanks!
@TrueTalenta
@TrueTalenta 9 ай бұрын
I am new to time series and this by far is very informative and quit succinct!
@a.h.s.3006
@a.h.s.3006 Жыл бұрын
I worked with time series before, and this tutorial is very thorough and well made. Additional features you could think about are lag/window features, where you basically try to let the model cheat from the previous consumption, by giving it a statistical grouping of previous values, let's say the mean of consumption within a window of 8 hours, or by outright giving the previous value (lag), let's say the actual consumption 24 hours ago. This will greatly improve performance, because it helps the model to go follow the expected trend.
@robmulla
@robmulla Жыл бұрын
Thanks for the comment! Glad you enjoyed the video even though you already have experience with time series. You are 100% correct about the lag features. Check out part 2 where I go over this and a few other topics in detail.
@adityaraikwar6069
@adityaraikwar6069 9 ай бұрын
Being a sort of early intermediate data scientist myself, it's very cool watching him do all these things and the most amazing thing is how everybody's mind works differently and how proficient you become in not only coding but also in approach towards a problem. keep that up man
@paultvshow
@paultvshow 6 ай бұрын
Hey, have you landed a job in data science field?
@digitalnomad2196
@digitalnomad2196 4 ай бұрын
also curious to know, recent data science graduate here@@paultvshow
@sandyattcl
@sandyattcl Жыл бұрын
what an amazing tutorial! I just had to give a thumbs up even before finishing the video.
@robmulla
@robmulla Жыл бұрын
Really appreciate that Sandeep. Please share the link with anyone else you think might also like it.
@69nukeee
@69nukeee 7 ай бұрын
Such an amazing video, thank you Rob and keep 'em coming! ;)
@H99x2
@H99x2 Жыл бұрын
Incredible content and explanation. You definitely have a knack for this. I subscribed for more videos like this! Thanks :)
@robmulla
@robmulla Жыл бұрын
Thanks for watching and the feedback!
@lolmatt9
@lolmatt9 4 ай бұрын
Very well explained and useful. Thank you!
@Arieleyo
@Arieleyo Жыл бұрын
Love your videos Rob!! cheers from Argentina ♥
@robmulla
@robmulla Жыл бұрын
Sending my ❤ back to Argentina. Thanks for watching!
@leo.y.comprendo
@leo.y.comprendo Жыл бұрын
This is incredible! Instantly subscribed!! thanks for your knowldege
@robmulla
@robmulla Жыл бұрын
Thanks for watching!
@akshaymbhat9144
@akshaymbhat9144 Жыл бұрын
Thanks for the wonderful video. It's very insightful ❤️ from India . Keep inspiring and aspiring always!!
@robmulla
@robmulla Жыл бұрын
My pleasure! So happy you liked it!
@azizbekurmonov6278
@azizbekurmonov6278 11 ай бұрын
Thanks! Love your explanations.
@egermani
@egermani Жыл бұрын
Great content! Thanks a lot for the explanations, they are a great incentive to dive deeper into the subject.
@robmulla
@robmulla Жыл бұрын
Glad you think so! My hope is that by making short videos that explain a topic at a high level like this will spark curiosity in people so they will dive deeper into the topic, just like you said.
@peralser
@peralser Жыл бұрын
Great Video ROB, Thanks for sharing with us!!
@robmulla
@robmulla Жыл бұрын
Thanks for watching!
@inovosystemssoftwarecompan6724
@inovosystemssoftwarecompan6724 4 ай бұрын
short and potent, great fluid presentation !!
@evandrogaio7003
@evandrogaio7003 Жыл бұрын
Such an excellent video. Thanks for sharing!
@robmulla
@robmulla Жыл бұрын
Glad you liked it!
@michaelmebratu2921
@michaelmebratu2921 Жыл бұрын
What a quality tutorial! Thank you so much
@robmulla
@robmulla Жыл бұрын
Glad you learned something new!
@user-xr3bc4vn5t
@user-xr3bc4vn5t 7 ай бұрын
You have helped me so much with this video, you don't even know!!! Thanks so much :)
@lovettolaedo223
@lovettolaedo223 8 ай бұрын
I enjoyed watching this as it has given me more insight into prediction. Kindly do a video on GDP growth forecasting using machine learning. Thank you.
@yosafatrogika3129
@yosafatrogika3129 Жыл бұрын
so clear explanation, thanks for sharing!
@robmulla
@robmulla Жыл бұрын
Glad it was helpful!
@PRATEEK30111989
@PRATEEK30111989 4 ай бұрын
I have never seen a better data science video. You are a savant at this
@kvafsu225
@kvafsu225 Жыл бұрын
Great lesson on machine learning. Thank you.
@robmulla
@robmulla Жыл бұрын
Thank you for watching. Share with a friend!
@super-eth8478
@super-eth8478 Жыл бұрын
Dude your channel is a gold mine ..
@robmulla
@robmulla Жыл бұрын
Thanks so much for that feedback. Now share it with anyone you think might appreciate it too!
@super-eth8478
@super-eth8478 Жыл бұрын
@@robmulla Actually I have shared it to my friends . Cheers !
@prasadjayanti
@prasadjayanti Ай бұрын
Very good explanation.
@tatulialphaidze90
@tatulialphaidze90 Жыл бұрын
Thank you for this tutorial, definitely helped me out
@robmulla
@robmulla Жыл бұрын
Glad it helped!
@lamborghiniveneno8423
@lamborghiniveneno8423 Жыл бұрын
Simply awesome tutorial😀
@robmulla
@robmulla Жыл бұрын
Thanks so much!
@Tonitonichoppa_o
@Tonitonichoppa_o Жыл бұрын
This is the best!! Thank you so much :D 감사합니다!!
@yourscutely
@yourscutely Жыл бұрын
Perfectly explained, thanks a lot
@robmulla
@robmulla Жыл бұрын
You are welcome! Glad you found it helpful. Check out parts 2 and 3 and share with a friend!
@chrispumping
@chrispumping 10 ай бұрын
Very informative and easy to understand tutorial....Thanks you
@robmulla
@robmulla 10 ай бұрын
You are welcome! Thanks for watching.
@romanrodin5669
@romanrodin5669 Жыл бұрын
Great video! Very clear and easy for understanding! Thanks a lot for clear explanation! I've got a few questions though regarding lagging data for better prediction) will jump into next video, it seems I get an answer there) thanks again!
@robmulla
@robmulla Жыл бұрын
Glad you liked it. Yes, the next video covers it in more detail!
@tomshaw7179
@tomshaw7179 Жыл бұрын
Thanks for this video Rob. I am quite new to data science and this was really clear. Have you done a video on optimization maybe using light GBM?
@anatoliyzavdoveev4252
@anatoliyzavdoveev4252 7 ай бұрын
Fantastic video tutorial 👏👏🙏
@ramizajicek
@ramizajicek Жыл бұрын
Thank you for the great presentation
@robmulla
@robmulla Жыл бұрын
I appreciate you watching and commenting. Share with a friend!
@datalyfe5386
@datalyfe5386 Жыл бұрын
Just came across your channel, awesome content!
@robmulla
@robmulla Жыл бұрын
Welcome aboard! Glad you like it.
@demaischta1129
@demaischta1129 Жыл бұрын
This is so helpful. Thank You!!
@liliyalopez8998
@liliyalopez8998 Жыл бұрын
I just started studying ML and this tutorial is super helpful. I would like to see how you would use the model for forecasting future energy consumption though
@robmulla
@robmulla Жыл бұрын
Welcome to the wonderful world of ML Liliya! Yes, I did forget to cover that in detail but I may in a future video. It's just a simple extra step to create the future dates dataframe and run the predict and feature creation on it.
@ademhilmibozkurt7085
@ademhilmibozkurt7085 Жыл бұрын
I love this video. Please make more. Thanks
@robmulla
@robmulla Жыл бұрын
Thanks! I apprecaite the comment. Have you seen the part 2 that I have on this topic?
@gabrielmoreno2554
@gabrielmoreno2554 Жыл бұрын
Wow, this is exactly what I needed to learn to improve my COVID death predictor. Great job!
@robmulla
@robmulla Жыл бұрын
So glad you found this helpful. Thanks for watching!
@nguyenduyta7136
@nguyenduyta7136 Жыл бұрын
Best one I ever seen ❤thank so much.
@robmulla
@robmulla Жыл бұрын
So glad you like it. Thanks for the comment.
@blueradium4260
@blueradium4260 Жыл бұрын
Brilliant video, thank you :)
@robmulla
@robmulla Жыл бұрын
Thanks for taking the time to watch.
@gustavojuantorena
@gustavojuantorena Жыл бұрын
"And depending who you ask" 🤣Great video!
@robmulla
@robmulla Жыл бұрын
I’m glad you got the reference. I was hoping he would see and appreciate that part of the video.
@ChrisHalden007
@ChrisHalden007 Жыл бұрын
Great video. Thanks
@robmulla
@robmulla Жыл бұрын
Appreciate that 🙏
@raasheedpakwashi2961
@raasheedpakwashi2961 Жыл бұрын
LEGEND...no other words needed
@robmulla
@robmulla Жыл бұрын
Thank you 🙏
@wazzadec16
@wazzadec16 Жыл бұрын
FYI for anybody who is doing this recently. The part where combing training set and test set graphic and using a dotted line has to be modified. Before: '01-01-2015' After ax.axvline(x=dt.datetime(2015,1,1) Since matplotlib now needs it in a datetime series. I guess because of changing the index to a t0_datetime format?
@shrunkhalawankhede2611
@shrunkhalawankhede2611 8 ай бұрын
from datetime import datetime ax.axvline(x=datetime(2015,1,1), color='black', ls='--')
@Burnitall220
@Burnitall220 2 ай бұрын
This is incredible!!
@Lnd2345
@Lnd2345 Жыл бұрын
Great video, thanks.
@robmulla
@robmulla Жыл бұрын
Glad you liked it! Thanks for the feedback.
@Dongnanjie
@Dongnanjie 4 ай бұрын
Thank you, Rob!
@MeghaKorade
@MeghaKorade Жыл бұрын
Hello Rob, Great tutorial! I have a question - In eval_set you're using [(x_train, y_train), (x_test, y_test)] whereas in most data split practices I've seen validation set separated from training data (which not part of either training or testing set)? Can you please check at timestamp 14:02 ? I'm trying to implement something similar on an interesting dataset and this is a great tutorial!!
@datasciencesolutions2361
@datasciencesolutions2361 Жыл бұрын
Great job sincerely!
@robmulla
@robmulla Жыл бұрын
Thanks for the feedback!
@Mvobrito
@Mvobrito Жыл бұрын
Great video! If the goal was prediction only, and not inference (meaning you don't care about what's driving the energy consumption), you can the energy consumption of the previous days as feature for the model. When predicting consumption at T, you can use T-1, T-2, .. T-x. And even a moving average as feature as well.
@robmulla
@robmulla Жыл бұрын
I totally agree! It all depends on how far in the future (forecasting horizon) you are attempting to predict.
@lucasfescina
@lucasfescina Жыл бұрын
I love your videos
@haleemahabulaimon8081
@haleemahabulaimon8081 10 ай бұрын
I really appreciate it
@revathyb1663
@revathyb1663 10 ай бұрын
Great video. How are you taking into account the sequence in information while training the xgb model? Also, what method do you suggest while I deal with multiple time series, meaning say for example I have energy consumption from multiple regions and would like to have predict for each region.
@adityagavali3158
@adityagavali3158 11 ай бұрын
Thank for this!
@muhammadkashif7263
@muhammadkashif7263 Жыл бұрын
Amazing season ❤
@robmulla
@robmulla Жыл бұрын
I appreciate the feedback.
@robmulla
@robmulla Жыл бұрын
Thanks!
@THE8SFN
@THE8SFN Жыл бұрын
great tutorial
@robmulla
@robmulla Жыл бұрын
Thx!
@massoudkadivar8758
@massoudkadivar8758 Жыл бұрын
Perfect job👌
@mirror1023
@mirror1023 Жыл бұрын
Amazing video
@robmulla
@robmulla Жыл бұрын
Thanks!
@sunaxes
@sunaxes 3 ай бұрын
Would be useful to look at feature importance at the inflexion point of the test set performance and at the end of training and compare. Features highly ranked in both are the ones useful to understand pattern in data and also also satisfy labelling requirements.
@a.a.elghawas
@a.a.elghawas 11 ай бұрын
Cool video Rob!
@robmulla
@robmulla 11 ай бұрын
Thanks for watching!
@jiyanshsonofdr.rajesh8516
@jiyanshsonofdr.rajesh8516 Жыл бұрын
Nice explanation..
@robmulla
@robmulla Жыл бұрын
Thanks for liking
@AQ-jh5fr
@AQ-jh5fr Жыл бұрын
Nice tutorial and when you said quick tutorial you sure meant it xD, I had to pause like a 100 times. but still thanks for the video
@robmulla
@robmulla Жыл бұрын
Glad you liked the video. I'd rather it be too fast than too slow :D - you can always slow down the playback speed if that helps.
@AisyahAthifa
@AisyahAthifa Жыл бұрын
Nice tutorial 👍
@robmulla
@robmulla Жыл бұрын
Thank you 👍
@adityaghai220
@adityaghai220 4 ай бұрын
amazing video
@christianmannke2335
@christianmannke2335 4 ай бұрын
First of all, thank you for this comprehensive video. It helped me a lot to understand this kind of prediction better. However, what I still don't understand is how can I make predictions on new data that the model hasn't seen before? Let's say I want to make predictions from 2018-08-03 for the next 30 days.
@wells111able
@wells111able 10 ай бұрын
thanks a lot ,for a beginner
@magicdimension6073
@magicdimension6073 Жыл бұрын
Have you tried SARIMA Models for time series forecasting? I'm curious which perform better. Excelent content Rob!
@jianyugong8277
@jianyugong8277 Жыл бұрын
This video is the best I've seen! You are so good at explaining this. Instead of RMSE, could you please advise how I can show the confidence interval of the predictions? I tried to google an answer but nothing worked.
@robmulla
@robmulla Жыл бұрын
Thanks so much for the kind words. Unfortunately with a model like xgboost there are no confidence intervals. However something like an ARIMA or fbprohet model (which i'm planning on making another video about) can give you confidence intervals. Check out part 2 if you haven't already!
@mohamednedal
@mohamednedal 7 ай бұрын
Hi Rob, Great tutorial! Could you please make a tutorial on how to use Shapley values to interpret LSTM models for timeseries forecasting?
@gui250493
@gui250493 Жыл бұрын
Well done!
@robmulla
@robmulla Жыл бұрын
Thank you sir!
@azizbekurmonov6278
@azizbekurmonov6278 11 ай бұрын
more time series, please
@kaaz4044
@kaaz4044 10 ай бұрын
A question. I see the prediction was done on test data which are already available. This is good to see how accurate the model is but I am wondering how we can use this model (and xgboost in general) to forecast the upcoming years for which we do not have any data.
@SabahMahjabeenSarwar
@SabahMahjabeenSarwar 2 ай бұрын
HI thanks for this amazing video. Do you have any video where you have done the improvements that you have mentioned ? Also any link for the code ?
@abinsharafm.s5168
@abinsharafm.s5168 Жыл бұрын
I follow you on twitch.. you should definitely do a video on how you setup your system for data science ( I mean you had Linux working with your ide and you were pulling data from the websites (api).. i found that very cool ! )
@robmulla
@robmulla Жыл бұрын
Oh. Great idea! I’ve thought about doing this but need to think more about how to best explain my setup.
@anwarsaidan3959
@anwarsaidan3959 18 күн бұрын
Hi Rob, Thank you very much for this tutorial. When using XGBoost , we don't do these kinds of data prep : scaling, checking for seasonality, filtering outliers ?
@santinonanini6107
@santinonanini6107 8 ай бұрын
Should you not split the training data into train and validation sets, such that you can use validation set instead of test set during training ? (when you use "eval_set" parameter ?)
@neclis7777
@neclis7777 Жыл бұрын
Excellent video ! For weather, I suggest you look into HDD and CDD (heating degree days and cooling degree days) which focus on the amount of heating and cooling rather than the mean temperature.
@robmulla
@robmulla Жыл бұрын
Thanks for the tips! I'm not familiar with those but I will look into it. The one main issue I see when people are training forecasting models like this is using the ground truth weather for future dates- which are not available at the time of prediction. That's why I think it's best to use forecast values from the historic dates.
@user-cl1eb2hh8o
@user-cl1eb2hh8o 3 ай бұрын
謝謝!
@user-cf5pf7on7k
@user-cf5pf7on7k 8 ай бұрын
Great video - you briefly mentioned stationarity in the beginning, but you didn't actually test for it. This data looks stationary to me, but if it wasn't would that cause a problem? Or is that only an issue with ARIMA models? Thanks!
@alghanimaa
@alghanimaa 3 ай бұрын
excellent introduction, is there an example of this approach with additional exogenous feature variables?
Time Series Forecasting with XGBoost - Advanced Methods
22:02
Rob Mulla
Рет қаралды 108 М.
Predict The Stock Market With Machine Learning And Python
35:55
Dataquest
Рет қаралды 624 М.
🍟Best French Fries Homemade #cooking #shorts
00:42
BANKII
Рет қаралды 34 МЛН
Pray For Palestine 😢🇵🇸|
00:23
Ak Ultra
Рет қаралды 33 МЛН
КАК СПРЯТАТЬ КОНФЕТЫ
00:59
123 GO! Shorts Russian
Рет қаралды 3 МЛН
Time Series Forecasting with Machine Learning
13:52
CodeEmporium
Рет қаралды 141 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 258 М.
How to build ARIMA models in Python for time series forecasting
20:38
Lianne and Justin
Рет қаралды 61 М.
Long Short-Term Memory (LSTM), Clearly Explained
20:45
StatQuest with Josh Starmer
Рет қаралды 476 М.
All Learning Algorithms Explained in 14 Minutes
14:10
CinemaGuess
Рет қаралды 156 М.
Build Your First Pytorch Model In Minutes! [Tutorial + Code]
31:32
But what is a neural network? | Chapter 1, Deep learning
18:40
3Blue1Brown
Рет қаралды 16 МЛН
181 - Multivariate time series forecasting using LSTM
22:40
DigitalSreeni
Рет қаралды 264 М.
This INCREDIBLE trick will speed up your data processes.
12:54
Rob Mulla
Рет қаралды 255 М.