When to Change Dev/Test Sets (C3W1L07)

DeepLearningAI · Beginner ·📐 ML Fundamentals ·8y ago

Key Takeaways

Determines when to change development and test sets in machine learning

Full Transcript

you've seen how such ever death sets and evaluation metric is like placing a target somewhere for your team to aim at but sometimes partway through a project you might realize you put your target in the wrong place in that case you should move your target let's take a look at an example let's say you built a CAD classifier to try to find lots of pictures of cats to show to your can't loving users and the message if you decide to use is classification error so Avram's a and B have respectively three percent error and five percent error so it seems like Gotham a is doing better but let's say you try out these algorithms you look at these algorithms and album a for some reason is letting through a lot of pornographic images so if you ship algorithm a the users would see more cat images because you know see percent error is identifying cats but it also shows you users some holographic images which is totally unacceptable but for your company as well as for your users and in contrast album B as five percent error so it lists classifies fewer images but it doesn't have pornographic images so from your company's point of view as well as from a user acceptance point of view album B is actually much better algorithm because you know it's not learning through any common graphics images so what's happened in this example is that album a is doing better on the evaluation metric is giving three percent error but is actually worse algorithm so in this case the evaluation metric plus the DEF set it prefers album a because the same look around a has lower error which is the metric is using when you're you and your users prefer a ver and B because it's not learning through Paulo graphics images so when this happens when your evaluation metric is no longer correctly rank ordering preferences between algorithms in this case is miss predicting that album a is a better algorithm then there's a sign that you should change your evaluation metric or perhaps you're on development sets or test set so in this case Dimas classification error metric that you're using can be written as follows as 1 over M a number of examples in your development set of sum from I equals 1 to M and depth number of examples of development set of indicator whether or not the prediction example I a development set is not equal to the actual label I wear this is useless notation to denote about their predictive value right so either 0 and this indicator function notation counts up the number of examples on which you know this thing in sign is true so this formula just counts up the number of misclassifying examples so the problem with this evaluation metric is that they trees pornographic and non pornographic images equally but you really want to conspire to not miss label pornographic images like maybe recognize a pornographic images academician therefore show it to a unsuspecting users therefore very unhappy with you know unexpectedly seeing porn so one way to change this evaluation metric would be if you had a weight term here and we call this WI where WI is going to be equal to 1 in front X I is non porn and maybe 10 or maybe even larger number like 100 if X I is porn so this way you're giving a much larger weight to examples that are pornographic so that the error term goes up much more on the algorithm this makes mistakes on classifying appalling graphics images a cat image and in this example you're giving a 10 times bigger wings to classifying on the graphic images correctly and if you want this normalization constant it will be right technically this becomes sum over I of WI so then this error would still be between 0 on 1 so the details of this weighting aren't important and actually influences waiting you need to actually go through your def in 10 sets to label the poly graphic images in your def and test sets you can implement this weighting function but a high level takeaway is if you find that you valuation metric is not giving the correct rank order preference for what is actually better algorithm then that's a time to think about defining a new evaluation metric that you know and this is just one possible way that you could define an evaluation metric and the goal of the evaluation metric is to accurately tell you give in to class size which one is better for your application for the purpose of this video don't worry too much about the details of how we define a new error metric the point is that if you're not satisfied with your own error metric then don't keep coasting with an error metric you're unsatisfied with is that try to define a new one that you think better captures your preferences in terms of what's actually a better algorithm one thing you might notice is that so far we've only talked about how to define a metric to evaluate classifiers that is what defines an evaluation metric that helps us better rank all their classifiers when they are performing at varying levels in terms of streaming out porn and this is actually an example of a full realization where I think you should take a machine learning problem and break it into distinct steps so one knob or one step is to figure out how to define a metric they captures what you want to do and I will is separately about how to actually do well on this metric so I think of the machine learning tasks as two distinct steps to use the target analogy the first step is to place the target so define where you want to aim and then it's a completely separate step so this is one knife you could tune which is how do you place the target and it's completely separate problem think of it as a separate knob to tune in terms of how to do well at a target or how to you know aim accurately or how to shoot at the target and so defining a metric is step one and you do something else for step two so in terms of shooting the target maybe your learning algorithm is optimizing some cost function that looks like this are you minimizing this you know some losses on your training set so one thing you could do is to also modify this in order to incorporate these weights and maybe you end up changing this normalization constant as well suggest one over sum of WI between the details of how you define J is important but the point was with the philosophy for formalization think of placing the target that's one step and aiming and shooting the target as a distinct step which you do separately so so in other words I encourage you to think of defining the metrics as one step and then you can and only after you've defined in metric figure out how to do well on that metric which might be changing the cost function J that your network is optimizing but for going on let's look at just one more example let's say that you're two cat classifiers a and B have respectively 3 percent error and 5 percent error as evaluated on your death set or maybe even on your test set which are images downloaded off the internet so high quality well frame images but maybe we need to tour your album a product you find that averin B actually looks like it's performing better even though it's doing better or your death set and you find that you've been training off very nice high quality images download without the internet but when you deploy this on a mobile app users are uploading all sorts of pictures much less trained you're going public the Catholic has twenty fish expressions maybe images are much blurrier and when you test out your algorithms you find that a from B is actually doing better so this would be another example of your metrics and depth test set falling down and the problem is that you're evaluating on a different test set a very nice high resolution well fairing images but what your users really care about is the album doing well on images they're uploading which are maybe less professional shots and blurrier and less wall frames so the guideline is they're doing well on your metrics and your current deficit or different test sets distribution if that does not correspond to doing well on the application you actually care about then change your metrics and/or your depth test set so in other words you can discover that your dev test set has these very high quality images but evaluating on this dev test set is not predictive of how well your app actually performs because you asked me to view of lower quality images then that's a good time to change your dev test set so that your data better reflects the type of data you actually need to do well on but your vote guideline is really if your current metrics and data and your validating on doesn't correspond to do well and what you actually care about and change your metric and/or your depth test set submit to capture what you need the album to actually do well on having the evaluation metrics and the death set allows you to much more quickly make decisions about this album a or ever be better so it really speeds up how quickly you or your team can iterate so my recommendation is even if you can't define the perfect evaluation metric and DEF set just set something up quickly and use that to drive the speed of your team iterating and then later down the line you find out that it wasn't a good one you're a better idea change it at that time it's perfectly okay but what I recommend it so most teams is to run for too long without an evaluation metric and depth set because that can slow down the efficiency or who should team can iterate and improve your algorithm so that's it on when to change your evaluation measures and/or depth and test sets hope that these guidelines help you serve your whole team to have a well-defined target you can iterate efficiently towards improving performance on

Original Description

Take the Deep Learning Specialization: http://bit.ly/39ufNQm 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 · 0 of 60

← Previous Next →
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
43 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

Related Reads

📰
Seeing Pictures the Way a Clustering Algorithm Does: Image Segmentation with K-Means, GMMs, and…
Learn image segmentation using K-Means, Gaussian Mixture Models, and Mean Shift algorithms to understand how clustering algorithms see pictures
Medium · Data Science
📰
How to Crush FAANG Coding Interviews in 3 Months: The Neo Way
Learn how to prepare for FAANG coding interviews in 3 months with a structured approach
Dev.to · Timevolt
📰
Logistic Regression: Formulation
Learn the formulation of logistic regression and its application in machine learning, including expressiveness delineation and model specification.
Dev.to · Ethan Davis
📰
Getting Started with Docling!
Learn to get started with Docling, a document AI tool, and explore its applications in machine learning and OCR using Python
Medium · Machine Learning
Up next
Part 2 | MLOps On GitHub | Deploy and Automate ML Workflow |Using GitHub Actions and CML for CI & CD
Abonia Sojasingarayar
Watch →