- 24
- 15 651
Timely Time Series
เข้าร่วมเมื่อ 15 ก.ค. 2023
Sharing my data science projects on real-life time series datasets.
TIME SERIES CLASSIFICATION | I Think I Failed This One 😔
This video explores a classification model, namely Multivariate LSTM-FCNs, which combines Long Short-Term Memory (LSTM) with a Convolutional Network (Fully Convolution Network or FCN). Then, we try to use this model to predict whether a company goes bankrupt or not.
I'd like to share some other things I've tried but didn't get to record it:
1. Normalization. In neural networks, the common practice is to normalize the data before throwing it into the model. It's said over and over that normalization would make a considerable improvement on the model performance. Even though in this video I didn't do that (we only normalize the data through the BatchNormalization layer), I also have tried it, and the AUCROC score couldn't reach 0.5.
2. Use Precision-Recall Curve instead of AUCROC. AUCROC could be misleading if we have severely imbalanced data, so perhaps I should have showed you the precision and recall score, even though AUC under ROC curve could still be used as a metric. I tried using PrecisionRecallDisplay from sklearn and got the average precision score to be near 0, both from the weighted and unweighted model (with and without normalization).
Now that I've finished editing this, a new thought come across my mind. If all modifications of the model still can't improve the metrics score, *then perhaps what we need is more data*. This might be one of those projects where we actually don't have enough data.
I'd really like to hear what you think. Thank you so much for watching!
Source code: www.kaggle.com/code/leesstephanie/time-series-classification-for-business
00:00 Intro
01:10 The model overview
02:57 LSTM & FCN
08:32 Squeeze and excite blocks
13:17 More details on the model
Application with Python:
17:04 The data
21:35 The model (without class weights)
30:45 Weighted model
34:24 Do we have the winner?
#timeseries #classification #timeseriesclassification #LSTM #convolution #machinelearning #pythonprogramming
I'd like to share some other things I've tried but didn't get to record it:
1. Normalization. In neural networks, the common practice is to normalize the data before throwing it into the model. It's said over and over that normalization would make a considerable improvement on the model performance. Even though in this video I didn't do that (we only normalize the data through the BatchNormalization layer), I also have tried it, and the AUCROC score couldn't reach 0.5.
2. Use Precision-Recall Curve instead of AUCROC. AUCROC could be misleading if we have severely imbalanced data, so perhaps I should have showed you the precision and recall score, even though AUC under ROC curve could still be used as a metric. I tried using PrecisionRecallDisplay from sklearn and got the average precision score to be near 0, both from the weighted and unweighted model (with and without normalization).
Now that I've finished editing this, a new thought come across my mind. If all modifications of the model still can't improve the metrics score, *then perhaps what we need is more data*. This might be one of those projects where we actually don't have enough data.
I'd really like to hear what you think. Thank you so much for watching!
Source code: www.kaggle.com/code/leesstephanie/time-series-classification-for-business
00:00 Intro
01:10 The model overview
02:57 LSTM & FCN
08:32 Squeeze and excite blocks
13:17 More details on the model
Application with Python:
17:04 The data
21:35 The model (without class weights)
30:45 Weighted model
34:24 Do we have the winner?
#timeseries #classification #timeseriesclassification #LSTM #convolution #machinelearning #pythonprogramming
มุมมอง: 155
วีดีโอ
FORECAST Gold Price for The Last Quarter of 2024 with NHITS
มุมมอง 235หลายเดือนก่อน
In this video, we will implement NHITS to predict the average daily gold price in Q4 of 2024. In addition to historical prices, we will also use the average daily S&P500 index and other exogenous variables. NHITS is a deep-learning model designed for long-term forecasting. At its core, NHITS uses interpolation to generate forecasts and backcasts. In the coding section, we will compare predictio...
What Is the KEY DIFFERENCE Between Long and Wide Data? 🔍
มุมมอง 1242 หลายเดือนก่อน
In this video, I just want to share what I've learned about differentiating long and wide data format. I really hope this video can help anyone with the same struggle! 00:00 Intro 01:41 Roles in a dataframe 03:18 The key difference (with examples) 11:21 Reshaping the dataframes using Pandas library Source code: github.com/stephanielees/Long-vs-Wide #datascience #timeseries #pandaslibrary #datas...
TIME SERIES CLUSTERING | HDBSCAN for Clustering 811 Products Sales
มุมมอง 2602 หลายเดือนก่อน
In this video, we are going to learn HDBSCAN, which is a density-based algorithm for clustering. Then, we will apply it to find clusters of weekly sales transactions. HDBSCAN can be used with any distance metric, but we will use two only: Euclidean and Dynamic Time Warping (DTW). We will see how the clustering results differ between the distance formulas. Source code: www.kaggle.com/code/leesst...
TIME SERIES CLASSIFICATION | Align the Shape & Measure the Distance
มุมมอง 5123 หลายเดือนก่อน
In this video, we learn one of many variations of Dynamic Time Warping (DTW) algorithm, namely ShapeDTW. Then, we will apply it to classify bird sounds. There will be 4000 recordings in the training dataset and 1000 recordings in the validation one. You can also see how I compute the ShapeDTW faster for all those recordings (2 hours vs 12 hours). 00:00 Intro 01:23 Brief explanation of ShapeDTW ...
Let's FORECAST the Electricity Production for the Next 2160 Hours
มุมมอง 3604 หลายเดือนก่อน
NBEATS is a deep learning model which chains many simple fully connected layers and basis expansion layers to generate forecasts. In this video, we will use NBEATS model to do long term forecasting of electricity production from renewable energy resources in Romania. [EDIT]: There are a few overlapping videos. Sorry about that! 😭🙏 I'll be more careful next time. Source code: www.kaggle.com/code...
Electricity Production FORECASTING with Neural Hierarchical Interpolation ⚡
มุมมอง 3914 หลายเดือนก่อน
In this video, we are going to forecast the electricity production using renewable energy resources for three months. Since the time series we have is an hourly time series, this task could be referred to as long term forecasting. The model we will learn in this video is Neural Hierarchical Interpolation for Time Series Forecasting (NHITS). Link to the data: www.kaggle.com/datasets/stefancomani...
BAYESIAN TIME SERIES | Do Natives Still Say This? 🌧🐱🐶🌞
มุมมอง 2136 หลายเดือนก่อน
In this video, we want to use Bayesian statistics to smooth a time series of 4-gram frequency. The smoothed series would be used to answer our question of whether native speakers still use the phrases discussed in the video. The data is from 1980 to 2019. Source code: github.com/stephanielees/smoothingNGram 00:00 Intro 00:26 The data 02:45 Dynamic Linear Model (DLM) 07:32 Filtering, aka fitting...
TIME SERIES CLASSIFICATION | Increase Accuracy by 10% This Way
มุมมอง 7047 หลายเดือนก่อน
When a dataset of asphalt pavement type is first used in a paper published in 2018, MiniRocket has not been introduced yet. So, in this video, we will apply MiniRocket, an algorithm to transform time series, to that dataset and see if there is an improvement in accuracy. The input is a univariate time series, but the length of each observation varies. By the total classes, this is a multiclass ...
DISTANCE between TIME SERIES: Derive It, Align It
มุมมอง 7467 หลายเดือนก่อน
In this video, we discuss how we can apply Derivative Dynamic Time Warping to compute distance between pairs of CPI (Consumer Price Index) time series in a dataset. Distance between time series can be very useful for time series clustering and time series classification. 00:00 Intro 00:31 Distance between time series 03:26 DTW 14:48 Derivative DTW (DDTW) 16:29 Make a distance matrix Application...
TIME SERIES CLUSTERING | How Can We Group the CPI Series?
มุมมอง 1.7K8 หลายเดือนก่อน
We have 19 series of CPI (Consumer Price Index, which is usually used as an indicator for inflation). Their lengths are unequal, and we want to cluster them using agglomerative clustering. In this video, we learn the agglomerative clustering algorithm and apply it with sklearn, a well known Python library for machine learning. A little note for the dendrograms. People say a picture has a thousa...
CLUSTERING for TIME SERIES | In Search of Similarities in CPI 🇺🇸
มุมมอง 2148 หลายเดือนก่อน
In this video, we see how to cluster time series of the consumer price index (CPI) of the United States. This video explains more about the data preprocessing and (one of) the cluster results. There are two important parts in this video: distance calculations and clustering. I'm going to elaborate those topics in the next two videos. #timeseriesanalysis #clustering #economics #consumerpriceinde...
Gold TIME SERIES FORECASTING With Neural Network 💰
มุมมอง 2.1K9 หลายเดือนก่อน
In this video, we are applying a simple neural network (the one we built when we first started learning about neural networks and deep learning) to forecast the high price of gold. Another thing to look forward to is to see whether holidays can give us a good forecast for gold's price. While editing this video, I realized that perhaps I should add a quarterly seasonality feature. What do you th...
TIME SERIES CLASSIFICATION | Let's Learn from My Mistakes 🌱
มุมมอง 88210 หลายเดือนก่อน
In this video, we look at some approaches that could not give us high AUC scores. I also share my opinion about why they don't work really well. After editing this video, I feel like at least one of the lessons might sound like an obvious lesson. But, I guess, we can just forget about it sometimes when we are searching for the best models. Thank you so much for watching! 00:00 Intro 00:44 Descr...
TIME SERIES CLASSIFICATION | Spot SHAPELETS In a Time Series
มุมมอง 2.5K11 หลายเดือนก่อน
Using SHAPELETS to categorize sensor time series data. The Learning Time-series Shapelets algorithm is used to transform the sequence dataset, then Gradient Boosting Classifier will be used to predict the label. Learning Time-series Shapelets is an algorithm to learn shapelets. Its formulation is developed from logistic regression. 00:00 Introduction 01:05 Brief description of shapelets 02:24 F...
TIME SERIES CLASSIFICATION | Go Fast and High with ROCKET 🚀
มุมมอง 2.2K11 หลายเดือนก่อน
TIME SERIES CLASSIFICATION | Go Fast and High with ROCKET 🚀
TIME SERIES FORECASTING | Using MA, Polynomial, and Seasonal to Forecast Bond Yield
มุมมอง 231ปีที่แล้ว
TIME SERIES FORECASTING | Using MA, Polynomial, and Seasonal to Forecast Bond Yield
TIME SERIES MODELLING | Apply Quadratic Growth and Moving Average (MA) Model for US Treasury
มุมมอง 125ปีที่แล้ว
TIME SERIES MODELLING | Apply Quadratic Growth and Moving Average (MA) Model for US Treasury
Using Dynamic Linear Model to Impute Missing Values in a PM 2.5 Time Series
มุมมอง 523ปีที่แล้ว
Using Dynamic Linear Model to Impute Missing Values in a PM 2.5 Time Series
TIME SERIES FORECASTING | Predicting 10-Year US Bond Yield Rate With LSTM
มุมมอง 630ปีที่แล้ว
TIME SERIES FORECASTING | Predicting 10-Year US Bond Yield Rate With LSTM
Applying MLE for estimating the variance of a time series
มุมมอง 157ปีที่แล้ว
Applying MLE for estimating the variance of a time series
Forecasting Gold Price with Bayesian Forecasting Using Dynamic Linear Model
มุมมอง 562ปีที่แล้ว
Forecasting Gold Price with Bayesian Forecasting Using Dynamic Linear Model
Great video :) One question, why using such high dropout rate? Maybe using AdamW with weight_decay to regularize the models would provide better regularization/generalization. Best
The dropout rate is from the model specification. But yeah... actually we could try out some other values! I did play around with it briefly, but then totally forgot :D Thanks for your suggestions!
Hello. Can you also include NBEATSx too?
Hello, that's my plan, so stay tuned!
incredible work with the video! i learned alot from this video and hope youll do more in the future !
Glad you liked it! More to come :D
Keep up the good work. Thank you for the video
💪😄
Pls can you do video about mamba S4 s6 model with financial data and economic reports
Thanks for the suggestion. I'll see if I can make a video about that in an upcoming video 📚
Yes Nhit is powerful model what if I integrate the cubic spline or B-spline interpolation does this help for accurate FORCAST with multi frequency datasets
Hermite cubic is actually a variation of cubic spline (and so does the B-spline). If you're talking about the natural cubic spline, then the short answer is no. The interpolation functions available in the library are only Nearest neighbor, Piecewise linear, and Cubic (through Hermite cubic). Theoretically, though, you might be able to use a custom interpolation function, although this could be more challenging, especially if we're talking about the natural cubic spline interpolation. That's because the cubic spline requires the first AND second derivatives at each node. In Hermite cubic, though, we only need the function value and its first derivative at each node. Please note that the answer I just gave you only results from my thinking process based on my understanding of cubic splines and Hermite cubic. The choice of a specific interpolation function is never mentioned in the papers, so I might be wrong. Hope this helps!
Thank you for the video! It would be nice to see more videos about classification.
More to come! 😃
Hi, your channel is so valuable
Thanks for the kind words!
Ah and im building vprom autoencoder can i use it with hmc or mcmc model
Thank you ❤ pls can you apply simple mamba S4 s6 with daily frequency data and economic data pllllllllls❤
A whole channel about time series?? Nice 🤗
😄
Thank you very much! I have followed your videos about all the classification tasks. They are really helpful!
Thanks for the value that you provide I do a search about it and I found lwdtw & lsdtw & shapedtw++ ❤❤❤
yeah, there are so many variations of DTW
thank u for sharing, this video is so valuable
There are a few overlapping videos. Sorry about that! 😭🙏 I'll be more careful next time.
@@TimelyTimeSeries keep going I need you I'm self learner I need more knowledge I'm seek in math but I use the models I believe that not the models predict the future but God see you working and the low of the life is the moving to something create the opportunity and bias
Thereis oppurtunity to make code together
@@IndraWiharjaa ok lets do it
Best channel Thankyou ❤❤
I try to use pykx package from kdb pls can you help me
Oh god were are you I wait for your videos thank you ❤❤❤
If you will try Bilstm and attention together, that can give good benchmarks.
Worth trying. Thanks for the insight!
Oh yeah this is what I want to see like notification ❤❤
Did rocket work better?
I haven't tried applying Rocket since we don't have the implementation code for datasets with unequal length of inputs, unless we preprocess the input by padding. I didn't give any padding to the input (haven't tried it either... perhaps I'll try it in the future) because I want to try using minimum data preprocessing. So, I use MiniRocket in this video because the implementation code is available in sktime library. And yes, MiniRocket works better. Maybe Rocket could work as well because according to the paper, MiniRocket, theoretically, gives roughly the same accuracy as Rocket. The huge difference between MiniRocket and Rocket is that MiniRocket works much faster than Rocket.
You are so smart and briliant data analyst❤
thank you for the video pls dont take alot of time i love your videos 😍😍😍
Thank you I'll try my best!
Excellent video. I thoroughly enjoyed commentary on "failures", and analysis of underlying causes. Thank you for this great content.
Thanks for your kind words. Glad you enjoyed it!
awsome video thank you alot
Nice review!
Thank you, Professor Keogh!
love from algeria pls dont take long time put more video you are my best channel
I don't understand time series analysis much, but this video is gold. Love from Pakistan. ♥
You deserve medal🥇 Great work. Keep it up❤
Thank you so much!
Great video!
Hi, thank you!
Would a recurrent neural network work for predicting time series?
It might work. Recurrent Neural Network is one of several networks built for processing sequences.
Hi Stephanie . Congratulations on your videos. They are excellent. By the way, I have also used linear dynamic models in my research. The problem is that the variances provided by 'dlmForecast' are very high. Therefore, the confidence interval is very wide. Have you ever dealt with this type of problem?
Hi, thanks for your kind words. Yeah, sometimes I got those high variances. The variance naturally increases as we forecast further ahead, but if the variance is already too high right from the very next timestamp, I guess it means that our model is not confident of the forecast? So maybe decreasing the value of dW in dlmPoly function (or any other DLM model you use) could help since the system variance, W, is one of the components of Q--the variance outputted by the dlmForecast function. When working on this project, I found out (and supported by the textbook) that the W could affect our forecast performance greatly. Or maybe you should try another DLM component like 'dlmPoly' with order of 2 or 3. Let me know if you have further questions. Hope this helps!
@@TimelyTimeSeries Amazing. I'll try that. Thanks a lot. Just for curiosity: my models consist of a level component (dlmModPoly) and a seasonality one (dlmModTrig). Unlike your model, I do not put values for the variances (V and W) of the level component. Instead, I estimate them by likelihood (with the dlmMLE function) and the output values are quite low (on the order of 10^-1). Maybe this is the problem, right?
@@jaironleal4287 It could be, especially if the distribution is not Gaussian (even though it might be difficult to prove that the series follows a Gaussian distribution). Or if you have 'wrong' components. I tried using dlmMLE in one of my videos (in my second video to be exact), and my prediction from that model was not way better than this video's prediction. Btw, I might be wrong, but I have an idea. Maybe you can try to just multiply (or divide) both V and W by 10 or 100 if you want to change those values but keeping the ratio. It just came to my mind that perhaps the ratio of V and W outputted by dlmMLE is the good ratio, but the numbers itself should be increased/decreased.
@@TimelyTimeSeries @TimelyTimeSeries Oh, I got it. In this case, I'd manipulate the 'signal-to-noise ratio' which means V/W. I'll do it. I'm sorry if I'm boring you but (if you allow me) I'd like to ask one last question (I promise 😅): have you ever needed to use a discount factor when using the dlm package? Maybe this could be a good feature, but I've never been able to understand if it's possible to do this with this package.
@@jaironleal4287 It's okay, don't worry 😀I really want to try using discount factor because, as you said, that really could help. But unfortunately, to my best knowledge, we can't apply discount factors with this package. And up till now, I haven't found a package in R or Python that could implement it.
great work
you are the best
Keep growing my friend.❤
I stumbled upon your tutorials recently and really enjoyed the content! You provide clear and concise explanations of complex topics. While I found your content valuable, I noticed the audio could be improved in some videos. Sometimes your voice echoes a bit, which might make it harder for some viewers to hear everything clearly. Overall, I'm impressed with your tutorials and excited to see more from you in the future. Keep up the great work!
Hi, thank you for your appreciation! I am still experimenting with audio, so thank you so much for your feedback. I will definitely try to reduce the echo in my future videos.
Was it successfully ?
Unfortunately, no😅 The real values, shown at the end of the reel, are lower than my predictions. So, while the model's predictions say that the bond yield would keep increasing, the real values keep decreasing. However, the bond yield did increase later to 4.27%, which is the model's prediction, in the following month (September 2023).
@@TimelyTimeSeriesI like your machine learning videos. I particularly liked the Bayesian video. Many TH-camrs show how they approximate the function of the security using the Lstm model and other models... but they have never predicted a price in the future using these methods, they use many methodes to predict the past price but not the Future price . I'm following a method that was developed by someone. This strategy is about deep forest algorithm, this method is about decision trees. With this method, the model learns to discover the same patterns that occur again and again, which are generated by the algorithm in the past in the form of triangles, squares, ovals in charts and copy them into the future chart. you can find these patterns yourself. The problem with this method is that you have to buy candlestick data for example closing price high low.. from Bloomberg terminal so that the program achieves more accurate results. Every TH-camr uses free databases like Yahoo. If you were to buy candle data using the methods shown, you would have high precision and high accuracy. I no longer follow the guy who developed this method but i use his method. He spend 30.000€ candle Stick data in month
Hi @metehan9185 , thanks for your feedback! And yeah, good data is really important so we can generate accurate predictions. Regarding deep forest, I see a lot of good time series forecasting models using deep forest (they didn't forecast bond price though). I plan to learn more about it soon.
@@TimelyTimeSeries Hi What I can tell you is that the person who developed this method, with the repeating patterns... has other mathematical calculations built into his program. He also incorporated Fourier transformation, because Fourier transformation is considered the most accurate iteration in machine learning, and he incorporated magnetic effect lines into some charts. These are lines that he calculated using Fourier transformation and said that the chart of a stock, for example Apple, must fall or rise to this line. He also uses a program to filter unnecessary price data such as knockouts. The program should be called Isolation forest. Using the decision trees, the program recognizes the same pattern that was filtered in the past with the Programm Isolation forest. He adds another important line, this line he calls main drive shafts. He calculates these main driving waves from the average value of the warrants to predict that the price could rise or fall to these lines. I think he uses mathematical models such as the Black Schols model, GARCH model, binomial model, Cox Ross Rubinstein model and averages these models to get to the main drive shafts. He thinks every strategy is bad and only works with this method. this method has a win rate of 84.4%. Too bad he had a TH-cam channel and deleted it. He has a TikTok account and streams there daily and explains his method every time. but only speaks German. But he also gives courses in English.
Hello (I am the inventor of Shapelets) very nice presentation, well done.
Hello, Mr. Keogh, nice to meet you. Thank you for saying that! I read your paper many times to understand Shapelets better. Your explanation of Shapelets by using leaves made me understand Shapelets immediately.
thanks for your kind words@@TimelyTimeSeries