Train/Dev/Test Sets (C2W1L01)

DeepLearningAI · Beginner ·📐 ML Fundamentals ·8y ago

Key Takeaways

The video discusses the importance of train, dev, and test sets in machine learning, including hyperparameter tuning and data splitting, and provides guidelines for setting up these sets.

Full Transcript

welcome to this course on the practical aspects of deep learning as now you've learned how to implement a neural network in this week you learn the practical aspects of how to make your neural network work well ranging from things like hyper parameter tuning to how to set of your data - how to make sure your optimization algorithm runs quickly so you get your learning algorithm to learn in a reasonable time in this first we will first talk about how the cellular machine learning problem they will talk about regularization and we'll talk about some tricks for making sure your neural network implementation is correct with that let's get started making good choices in how you set up your training development and test sets can make a huge difference in helping you quickly find a good high performance your network when training on your network you have to make a lot of decisions such as how many layers with your new network have and how many hidden units do you want each layer to have and what's the learning rate and what are the activation functions you want to use for the different layers when you're starting on a new application is almost impossible to correctly guess the right values for all of these and for other high performance a choices on your first attempt so in practice applying machine learning is a highly iterative process in which you often start with an idea such as you want to build a new network of a certain number of layers a certain number of units may be on certain data set and so on and then you just have the code up in trying it by running your code you run an experiment on the get back a result that tells you how well this particular network or this fluid configuration works and based on the outcome of you might then refine your ideas and change your choices and maybe keep iterating in order to try to find a better and a better neural network today deep learning has found great success in a lot of areas ranging from natural language processing to computer vision to speech recognition to a lot of applications on also structured data and structured data includes everything from advertisement to websearch which isn't just internet search engines is also for example shopping websites or really any website that wants to deliver great search results when you enter terms into the search bar - computer security - logistics such as figuring out where to send drivers to pick up and drop off things - many more so what I've seen is that sometimes a researcher with a lot of experience in NLP might enter you know might try to do something in computer vision or maybe a researcher with a lot of experience in speech recognition might you know jump in and try to do something on advertising or someone from security might want to jump and do something on logistics and what I've seen is that intuitions from one domain or from one application area often do not transfer to other application areas and the best choices may depend on the amount of data you have the number of input features you have your computer configuration and whether you're training on GPUs or CPUs and it's so exactly what configuration of GPUs and CPUs and many other things so for a lot of applications I think is almost impossible even very experienced deep learning people find it almost impossible to correctly guess the best choice of hyper parameters the very first time and so today apply deep learning is a very iterative process where you just have to go around this cycle many times to hopefully find a good choice of network for your application so one of the things they'll determine how quickly you can make progress is how efficiently you can go around the cycle and setting up your data sets well in terms of your train development and test sets can meet you much more efficient at that so if this is your training data let's draw that as a big box then traditionally you might take all the data you have and carve off some portion of it to be your training set some portion of it to be your hold out draws validation sets and this is sometimes also called the development set and for brevity I'm just going to call this the dev set but all of these terms being roughly the same thing and then you might carve out some final portion of it to be your test set and so the work though is that you keep on training algorithms on your training sites and use your dev set or your hold on trial validation set to see which of many different models performs best on your dev set and then after having done this long enough when you have a final model do you want to evaluate you can take the best model you have found and evaluate it on your test set in order to get a unbiased estimate of how well your algorithm is doing so in the previous era of machine learning it was common practice to take all your data and split it according to maybe a 70/30 percent um in terms of a people often talked about the 70/30 train tested if you don't have an explicit dev set or maybe you know a 60 20 20 percent split now in terms of 60 percent trained 20% dev and 20 percent test and several years ago this was widely considered best practice in machine learning if you have you know maybe 100 examples in total or maybe a thousand examples in total maybe after you know 10,000 examples these sorts of ratios were perfectly reasonable rules of thumb but in the modern Big Data error where for example you might have a million examples in total then the trend is that you're Devin 10 sets have been becoming a much smaller percentage of the total because remember the goal of the dev sets that the development set is that you're going to test different Avram's on it and see whichever works better so the death set just needs to be big enough for you to evaluate say two different algorithm courses or ten different averages and quickly decide which one is doing better and you might not need a whole 20 percent of your day for that so for example we have a million chin examples you might decide that just having ten thousand examples in your death set is more than enough to evaluate you know which one or two algorithms does better and in a similar vein the main goal of your test set is given your final classifier to give you a pretty confident estimate of how well it's doing and again if you have a million examples maybe you might decide that 10,000 examples is more than enough in order to evaluate a single qualifier and give you a good estimate of how well it's doing so in this example where you have a million examples if you need just 10,000 for your Devon 10,000 for your test your ratio would be more like 10,000 is 1% of 1 million so you have 98% trained 1% death 1% yes and I've also seen applications where if you have even more than million examples you might end up with you know 99.5% trained and 0.25 percent death 0.25 percent test or maybe a 0.4 percent deaf 0.1 percent test so just a recap when setting up your machine learning problem more often set up into a trained F and test sets and if you have a relatively small data set these traditional ratios might be okay but if you have a much larger data set is also fine to set your Devon test sets to be much smaller than you know 20% or even want to 10% of your data will give more specific guidelines on the sizes of Devon test sets later in this specialization one other trend we're seeing in the era of modern deep learning is that more and more people train on mismatched training test distributions let's say you're building an app that lets users upload than all the pictures and your goal is to find pictures of cats in order to show your users maybe all your users in canvas maybe your training set comes from cat pictures downloaded off the internet of then your Devon headset might comprise cat pictures from users using our app Samira training centers while the pictures traveled off the internet but the Devin testers are pictures uploaded by users turns out of all the web pages have very high resolution very professional very nicely framed pictures of cats but maybe your users are uploading you know blurrier lower res images just taken with a cell phone camera in a more casual condition and so these two distributions of data may be different the rule of thumb might encourage you to follow in this case is to make sure that deep dev and test sets come from the same distribution we'll see more about this particular guideline as well but because you will be using the death set you value a lot of different models and trying really hard to improve performance on a death set is nice if your death set comes from the same distribution as your test set but because deep learning algorithms are such a huge hunger for training data one trend I'm seeing is that you might use all sorts of creative tactics such as crawling webpages in order to acquire a much bigger training set than you would otherwise have even if part of the cause of that is then that your training set data might not come from the same distribution as your dev and test set but you find that so long as you follow this rule of thumb that progress in your machine learning algorithm will be faster and I'll give a more detailed explanation for this tutorial some dates and descritization as well finally it might be okay to not have a test set remember to go of the test set is to give you a unbiased estimate of the performance of your final network of the network that you selected but you don't need that unbiased estimate then it might be okay to not have a test set so what you do if you have only a death step and all the test size is you trained on the training set and then you try different model architectures evaluate them on the death set and then use that to iterate and try to get to a good model because you fit today to the dev set there's no long surgeon unbiased estimate of performance but if you don't need one that might be perfectly fine in the machine learning world when you have just a train on a deaf set but no separate test set most people will call this the training set and they will call the death set the test set but what they actually end up doing is using the test set as a holdout cross-validation Center which maybe isn't completely a great use of terminology because they're then overfitting to the chip set so when the team tells you that they have only a train and a test set you know I would just be cautious and think do they really have a trade deficits because they're overfitting to the test set culturally it might be difficult to change some of these teams terminology and get them to call it a train death sets rather than train test set even though I think calling it a train and development set would be more correct terminology and this is actually okay practice if you don't need a completely unbiased estimate of the performance of your algorithm so having set up a train death and test set to allow you to iterate more quickly it will also allow you to more efficiently measure that bias and variance of your algorithm so they can more efficiently select ways to improve your algorithm let's start to talk about that in the next video

Original Description

Take the Deep Learning Specialization: http://bit.ly/2VDnWxz Check out all our courses: https://www.deeplearning.ai Subscribe to The Batch, our weekly newsletter: https://www.deeplearning.ai/thebatch Follow us: Twitter: https://twitter.com/deeplearningai_ Facebook: https://www.facebook.com/deeplearningHQ/ Linkedin: https://www.linkedin.com/company/deeplearningai
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from DeepLearningAI · DeepLearningAI · 43 of 60

1 Forward and Backward Propagation (C1W4L06)
Forward and Backward Propagation (C1W4L06)
DeepLearningAI
2 deeplearning.ai's Heroes of Deep Learning: Yuanqing Lin
deeplearning.ai's Heroes of Deep Learning: Yuanqing Lin
DeepLearningAI
3 deeplearning.ai's Heroes of Deep Learning: Ruslan Salakhutdinov
deeplearning.ai's Heroes of Deep Learning: Ruslan Salakhutdinov
DeepLearningAI
4 deeplearning.ai's Heroes of Deep Learning: Yoshua Bengio
deeplearning.ai's Heroes of Deep Learning: Yoshua Bengio
DeepLearningAI
5 deeplearning.ai's Heroes of Deep Learning: Pieter Abbeel
deeplearning.ai's Heroes of Deep Learning: Pieter Abbeel
DeepLearningAI
6 deeplearning.ai's Heroes of Deep Learning: Ian Goodfellow
deeplearning.ai's Heroes of Deep Learning: Ian Goodfellow
DeepLearningAI
7 deeplearning.ai's Heroes of Deep Learning: Andrej Karpathy
deeplearning.ai's Heroes of Deep Learning: Andrej Karpathy
DeepLearningAI
8 Using an Appropriate Scale (C2W3L02)
Using an Appropriate Scale (C2W3L02)
DeepLearningAI
9 Gradient Checking (C2W1L13)
Gradient Checking (C2W1L13)
DeepLearningAI
10 Gradient Checking Implementation Notes (C2W1L14)
Gradient Checking Implementation Notes (C2W1L14)
DeepLearningAI
11 Learning Rate Decay (C2W2L09)
Learning Rate Decay (C2W2L09)
DeepLearningAI
12 Understanding Mini-Batch Gradient Dexcent (C2W2L02)
Understanding Mini-Batch Gradient Dexcent (C2W2L02)
DeepLearningAI
13 Mini Batch Gradient Descent (C2W2L01)
Mini Batch Gradient Descent (C2W2L01)
DeepLearningAI
14 The Problem of Local Optima (C2W3L10)
The Problem of Local Optima (C2W3L10)
DeepLearningAI
15 Exponentially Weighted Averages (C2W2L03)
Exponentially Weighted Averages (C2W2L03)
DeepLearningAI
16 Tuning Process (C2W3L01)
Tuning Process (C2W3L01)
DeepLearningAI
17 Understanding Exponentially Weighted Averages (C2W2L04)
Understanding Exponentially Weighted Averages (C2W2L04)
DeepLearningAI
18 Bias Correction of Exponentially Weighted Averages (C2W2L05)
Bias Correction of Exponentially Weighted Averages (C2W2L05)
DeepLearningAI
19 Gradient Descent With Momentum (C2W2L06)
Gradient Descent With Momentum (C2W2L06)
DeepLearningAI
20 Normalizing Activations in a Network (C2W3L04)
Normalizing Activations in a Network (C2W3L04)
DeepLearningAI
21 Hyperparameter Tuning in Practice (C2W3L03)
Hyperparameter Tuning in Practice (C2W3L03)
DeepLearningAI
22 Adam Optimization Algorithm (C2W2L08)
Adam Optimization Algorithm (C2W2L08)
DeepLearningAI
23 RMSProp (C2W2L07)
RMSProp (C2W2L07)
DeepLearningAI
24 Fitting Batch Norm Into Neural Networks (C2W3L05)
Fitting Batch Norm Into Neural Networks (C2W3L05)
DeepLearningAI
25 Why Does Batch Norm Work? (C2W3L06)
Why Does Batch Norm Work? (C2W3L06)
DeepLearningAI
26 Batch Norm At Test Time (C2W3L07)
Batch Norm At Test Time (C2W3L07)
DeepLearningAI
27 Softmax Regression (C2W3L08)
Softmax Regression (C2W3L08)
DeepLearningAI
28 Deep Learning Frameworks (C2W3L10)
Deep Learning Frameworks (C2W3L10)
DeepLearningAI
29 Neural Network Overview (C1W3L01)
Neural Network Overview (C1W3L01)
DeepLearningAI
30 Training Softmax Classifier (C2W3L09)
Training Softmax Classifier (C2W3L09)
DeepLearningAI
31 Why Deep Representations? (C1W4L04)
Why Deep Representations? (C1W4L04)
DeepLearningAI
32 Gradient Descent For Neural Networks (C1W3L09)
Gradient Descent For Neural Networks (C1W3L09)
DeepLearningAI
33 Neural Network Representations (C1W3L02)
Neural Network Representations (C1W3L02)
DeepLearningAI
34 TensorFlow (C2W3L11)
TensorFlow (C2W3L11)
DeepLearningAI
35 Activation Functions (C1W3L06)
Activation Functions (C1W3L06)
DeepLearningAI
36 Explanation For Vectorized Implementation (C1W3L05)
Explanation For Vectorized Implementation (C1W3L05)
DeepLearningAI
37 Getting Matrix Dimensions Right (C1W4L03)
Getting Matrix Dimensions Right (C1W4L03)
DeepLearningAI
38 Understanding Dropout (C2W1L07)
Understanding Dropout (C2W1L07)
DeepLearningAI
39 Building Blocks of a Deep Neural Network (C1W4L05)
Building Blocks of a Deep Neural Network (C1W4L05)
DeepLearningAI
40 Why Non-linear Activation Functions (C1W3L07)
Why Non-linear Activation Functions (C1W3L07)
DeepLearningAI
41 Computing Neural Network Output (C1W3L03)
Computing Neural Network Output (C1W3L03)
DeepLearningAI
42 Backpropagation Intuition (C1W3L10)
Backpropagation Intuition (C1W3L10)
DeepLearningAI
Train/Dev/Test Sets (C2W1L01)
Train/Dev/Test Sets (C2W1L01)
DeepLearningAI
44 Deep L-Layer Neural Network (C1W4L01)
Deep L-Layer Neural Network (C1W4L01)
DeepLearningAI
45 Random Initialization (C1W3L11)
Random Initialization (C1W3L11)
DeepLearningAI
46 Other Regularization Methods (C2W1L08)
Other Regularization Methods (C2W1L08)
DeepLearningAI
47 Normalizing Inputs (C2W1L09)
Normalizing Inputs (C2W1L09)
DeepLearningAI
48 Derivatives Of Activation Functions (C1W3L08)
Derivatives Of Activation Functions (C1W3L08)
DeepLearningAI
49 Parameters vs Hyperparameters (C1W4L07)
Parameters vs Hyperparameters (C1W4L07)
DeepLearningAI
50 Vectorizing Across Multiple Examples (C1W3L04)
Vectorizing Across Multiple Examples (C1W3L04)
DeepLearningAI
51 What does this have to do with the brain? (C1W4L08)
What does this have to do with the brain? (C1W4L08)
DeepLearningAI
52 Dropout Regularization (C2W1L06)
Dropout Regularization (C2W1L06)
DeepLearningAI
53 Vanishing/Exploding Gradients (C2W1L10)
Vanishing/Exploding Gradients (C2W1L10)
DeepLearningAI
54 Basic Recipe for Machine Learning (C2W1L03)
Basic Recipe for Machine Learning (C2W1L03)
DeepLearningAI
55 Bias/Variance (C2W1L02)
Bias/Variance (C2W1L02)
DeepLearningAI
56 Forward Propagation in a Deep Network (C1W4L02)
Forward Propagation in a Deep Network (C1W4L02)
DeepLearningAI
57 Weight Initialization in a Deep Network (C2W1L11)
Weight Initialization in a Deep Network (C2W1L11)
DeepLearningAI
58 Numerical Approximations of Gradients (C2W1L12)
Numerical Approximations of Gradients (C2W1L12)
DeepLearningAI
59 Regularization (C2W1L04)
Regularization (C2W1L04)
DeepLearningAI
60 Why Regularization Reduces Overfitting (C2W1L05)
Why Regularization Reduces Overfitting (C2W1L05)
DeepLearningAI

This video teaches the importance of setting up train, dev, and test sets in machine learning and provides guidelines for doing so. It covers the traditional train/dev/test set ratios and the modern trend of having smaller dev and test sets. The video also discusses the goals of the dev and test sets and how to use them to evaluate algorithm performance.

Key Takeaways
  1. Split data into train, dev, and test sets
  2. Determine the size of each set based on the dataset and goals
  3. Use the dev set to evaluate algorithms and the test set to get an unbiased estimate of model performance
  4. Iterate on the algorithm and hyperparameters using the train, dev, and test sets
💡 Having a train, dev, and test set allows for more efficient measurement of bias and variance of an algorithm and quicker iteration and improvement of the algorithm.

Related Reads

📰
5 Python Projects That Every Beginner should learn and make.
Learn Python by building 5 practical projects, accelerating your learning curve and gaining hands-on experience
Medium · Python
📰
Python’s Golden Age Is Over (And Nobody Wants to Admit It)
Python's popularity may be waning, learn why and what it means for developers
Medium · AI
📰
Support Vector Machine (SVM): A Complete Guide with the UniversalBank Dataset
Learn to build a Support Vector Machine (SVM) model to predict personal loan approval with 95.6% accuracy using the UniversalBank dataset
Medium · Machine Learning
📰
Support Vector Machine (SVM): A Complete Guide with the UniversalBank Dataset
Learn to predict personal loan approval using Support Vector Machines (SVM) with 95.6% accuracy on the UniversalBank dataset
Medium · Data Science
Up next
Mechanical Engineer to AI Engineer Career Switch. #artificialintelligence
Rajeev Kanth | BEPEC
Watch →