How to pick a machine learning model 4: Splitting the data
Skills:
Supervised Learning90%
Key Takeaways
This video teaches how to split data for training and testing machine learning models
Full Transcript
most often we are not handed separate training and testing datasets but rather one big grab bag of data when this is the case we are responsible for splitting it ourselves when we do this we have to keep in mind that there are two different broad categories of generalization interpolation and extrapolation depending on which we're interested in we will divide the data differently an example of interpolation is if we want to estimate the value of annual temperatures that we're missing from the middle of our data set in this case we know several values both before and after an example of extrapolation would be if we wanted to make estimates outside the range of our original data either for dates that come before or dates that come after another type of extrapolation would be applying the pattern to a different town nearby in both cases we would try to infer something about the world that extended beyond the reach of what we had measured if we wanted to divide our data set to test for interpolation performance it would be straightforward we could randomly sort every year's data into one of two bins testing or training this is what we did in part one however if we wanted to divide our data set to test for an extrapolation that would require a little more subtlety if we were interested in making predictions about the future for instance we would have to make sure to test the model on data from the future that it had never seen and never been trained on otherwise it would have an unfair advantage knowing what the temperature will be in two years helps to make a better prediction about what it will be next year knowing future year's temperatures would tip the model off to any upcoming trends or changes in temperature pattern most importantly this is an advantage that the model will not have when we put it into practice making predictions - honestly split the data into training and testing sets for extrapolation we would have to divide it by date training on all the data that came before and testing on all the data that came after that date this would give us a more realistic assessment more generally when dividing data into training and testing sets we want the data in the testing sets to be independent of all the data in the training set otherwise it's not a true test of the models ability to generalize there are subtle ways that data can be dependent on each other ways that knowing some bits can give you an unfair advantage when trying to predict other bits determining what constitutes independence often requires some domain knowledge for example if we wanted to test the generalizability of our model we could test it on the temperature data from another town but we would have to be careful our models ability to predict the pattern in annual temperatures for a town that was only one kilometer away wouldn't be sufficient that data would not be independent one kilometer is so close that the two towns would share not only underlying weather patterns but also the hyper local weather quirks using measurement from one to predict the other would not test the models generalizability however if we tested the model on temperatures from a town that was a hundred kilometers away that might be far enough away to be considered independent and would provide a better assessment of the models generalizability the ultimate measure of whether a train test split is appropriate is how the model will be used in practice is the training testing split representative of the conditions the model will experience when it's implemented if so you're good to go if not you're testing error might be artificially low giving you a false sense of security about how well your model is performing in high consequence applications being blind to your models weaknesses can lead to some very uncomfortable situations taking a close look at how you split your data into training and testing sets can save you this pain so now that we've covered the preparatory steps join me for part 5 where we talk about how to choose model candidates and how to handle hypothesis driven and Theory driven modeling
Original Description
Part of the End-to-End Machine Learning School course library at http://e2eml.school
See these concepts used in an End to End Machine Learning project:
https://end-to-end-machine-learning.teachable.com/p/polynomial-regression-optimization/
Watch the rest of the How to Choose a Model series:
https://end-to-end-machine-learning.teachable.com/p/building-blocks-choosing-a-model/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Brandon Rohrer · Brandon Rohrer · 38 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
▶
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Robot Learning with a Biologically-Inspired Brain (BECCA)
Brandon Rohrer
BECCA talk at AGI 2011
Brandon Rohrer
Robot Learning with a Biologically-Inspired Brain (BECCA), The Sequel
Brandon Rohrer
BECCA listens to The Hobbit
Brandon Rohrer
Learning the building blocks of speech: BECCA extracts a hierarchy of audio features
Brandon Rohrer
BECCA listens for sound effects in The Hobbit
Brandon Rohrer
BECCA finds movie trailers while watching the Big Bang Theory
Brandon Rohrer
Listening for unexpected sounds: BECCA detects anomalies in audio data
Brandon Rohrer
Learning the building blocks of vision: BECCA extracts a spatio-temporal hierarchy of features
Brandon Rohrer
Watching for the unexpected: BECCA detects anomalies in video data
Brandon Rohrer
BECCA finds a stationary target
Brandon Rohrer
BECCA finds a stationary target at 3X speed
Brandon Rohrer
BECCA watches the X-men and Bruce Lee
Brandon Rohrer
BECCA plays Quidditch
Brandon Rohrer
BECCA chases a ball
Brandon Rohrer
BECCA chases a ball, part 2
Brandon Rohrer
Becca chases a ball, part 3
Brandon Rohrer
BECCA creates features from MNIST
Brandon Rohrer
How reinforcement learning works in Becca 7
Brandon Rohrer
Deep Learning Demystified
Brandon Rohrer
How Data Science Works
Brandon Rohrer
How Convolutional Neural Networks work
Brandon Rohrer
How Bayes Theorem works
Brandon Rohrer
How Deep Neural Networks Work
Brandon Rohrer
Recurrent Neural Networks (RNN) and Long Short-Term Memory (LSTM)
Brandon Rohrer
How Support Vector Machines work / How to open a black box
Brandon Rohrer
How autocorrelation works
Brandon Rohrer
Getting closer to human intelligence through robotics
Brandon Rohrer
A minimalist's guide to slicing and indexing pandas DataFrames
Brandon Rohrer
How decision trees work
Brandon Rohrer
Data scientist archetypes
Brandon Rohrer
How to use python's datetime package
Brandon Rohrer
How optimization for machine learning works, part 1
Brandon Rohrer
How optimization for machine learning works, part 2
Brandon Rohrer
How optimization for machine learning works, part 3
Brandon Rohrer
How optimization for machine learning works, part 4
Brandon Rohrer
How convolutional neural networks work, in depth
Brandon Rohrer
How to pick a machine learning model 4: Splitting the data
Brandon Rohrer
How to pick a machine learning model 3: Choosing a loss function
Brandon Rohrer
How to pick a machine learning model 2: Separating signal from noise
Brandon Rohrer
How to pick a machine learning model 1: Choosing between models
Brandon Rohrer
How to pick a machine learning model 5: Navigating assumptions
Brandon Rohrer
What do neural networks learn?
Brandon Rohrer
Interview with iRobot's Director of Data Science Angela Bassa
Brandon Rohrer
How Backpropagation Works
Brandon Rohrer
Evolutionary Powell's method: A discrete optimizer for hyperparameter optimization
Brandon Rohrer
1D convolution for neural networks, part 1: Sliding dot product
Brandon Rohrer
1D convolution for neural networks, part 2: Convolution copies the kernel
Brandon Rohrer
1D convolution for neural networks, part 3: Sliding dot product equations longhand
Brandon Rohrer
1D convolution for neural networks, part 4: Convolution equation
Brandon Rohrer
1D convolution for neural networks, part 5: Backpropagation
Brandon Rohrer
1D convolution for neural networks, part 6: Input gradient
Brandon Rohrer
1D convolution for neural networks, part 7: Weight gradient
Brandon Rohrer
1D convolution for neural networks, part 8: Padding
Brandon Rohrer
1D convolution for neural networks, part 9: Stride
Brandon Rohrer
The Four Grand Challenges of Robots in the Home
Brandon Rohrer
How Convolution Works
Brandon Rohrer
The Softmax neural network layer
Brandon Rohrer
Batch normalization
Brandon Rohrer
Getting ready to learn Python, Mac edition #1: Files and directories
Brandon Rohrer
More on: Supervised Learning
View skill →Related Reads
🎓
Tutor Explanation
DeepCamp AI