What Are the 7 Steps of Machine Learning?

2.5M views
•
August 31, 2017
by
Google Cloud Tech
YouTube video player
What Are the 7 Steps of Machine Learning?

TL;DR

Applied machine learning follows seven steps: gathering data, data preparation, choosing a model, training, evaluation, hyperparameter tuning, and prediction. Using a wine-versus-beer example based on color and alcohol content, a model learns to separate the two by adjusting weights and biases until it can accurately predict answers on data it has never seen.

Transcript

[MUSIC PLAYING] YUFENG GUO: From detecting skin cancer to sorting cucumbers to detecting escalators in need of repair, machine learning has granted computer systems entirely new abilities. But how does it really work under the hood? Let's walk through a basic example and use it as an excuse to talk about the process of getting answers from your dat... Read More

Key Insights

  • Machine learning is using data to answer questions, where a question-answering system is called a model, and the model is created through a process called training that aims to produce accurate answers most of the time.
  • Gathering data is the first and critically important step, because the quality and quantity of data collected directly determine how good the resulting predictive model can be.
  • Features are the measurable aspects used for prediction; in the wine-versus-beer example, only two features are chosen: color measured as a wavelength of light and alcohol content measured as a percentage.
  • Data preparation involves loading data, randomizing its order so sequence does not affect learning, visualizing relationships, checking for data imbalances, and splitting the data into training and evaluation portions.
  • Data imbalance biases a model; if far more beer data than wine is collected, the model guesses beer for almost everything, which fails when the real world contains equal amounts of each drink.
  • Training uses the line formula y equals mx plus b, where only the slope m and intercept b are adjustable; with many features these become the weights matrix w and the biases, updated each training step to improve predictions.
  • Evaluation tests the trained model against data set aside and never used in training, showing how the model might perform in the real world, with a common training-evaluation split of 80-20 or 70-30.
  • Hyperparameters such as the number of passes through the training set and the learning rate are tuned experimentally; adjusting them remains more art than science and depends heavily on the dataset, model, and training process.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What are the 7 steps of machine learning?

The seven steps are gathering data, data preparation, choosing a model, training, evaluation, hyperparameter tuning, and finally prediction or inference. These steps form a foundational framework that applies across problem domains. You gather and prepare data, choose a model suited to your data type, train it to improve predictions, evaluate it against unseen data, tune hyperparameters to improve results, and then use the model to answer questions and realize the value of machine learning.

Q: How does machine learning tell if a drink is wine or beer?

The system collects two features for each drink: color measured as a wavelength of light using a spectrometer, and alcohol content measured as a percentage using a hydrometer. This produces training data pairing those measurements with whether each drink is beer or wine. A model is then trained to split the two types along these two factors, letting it predict whether a given drink is wine or beer based on its color and alcohol percentage rather than human judgment.

Q: Why is gathering data the most important step?

Gathering data is critically important because the quality and quantity of data collected directly determine how good your predictive model can be. If you gather too little data or imbalanced data, the model cannot learn accurate patterns. For example, collecting far more beer data than wine biases the model toward guessing beer for almost everything, which performs poorly in a real world where beer and wine appear in equal amounts. Good data is the foundation of an accurate model.

Q: Why do you split data into training and evaluation sets?

Data is split so the model can be tested on data it has never seen during training. If you evaluated on the same data used for training, the model could simply memorize the answers, just as you would not use the exact questions from your math homework on the math exam. The evaluation set represents how the model might perform in the real world. A common training-evaluation split is around 80-20 or 70-30, depending on the size of the original dataset.

Q: How does training a machine learning model actually work?

Training incrementally improves the model's ability to predict correctly. Using the straight-line formula y equals mx plus b, only the slope m and intercept b are adjustable values; with many features these form the weights matrix w and the biases. Training initializes random values for w and b, predicts outputs, compares them to the correct answers, and adjusts the values for more accurate predictions. Each cycle of updating weights and biases is one training step, moving a random line step by step toward ideal separation.

Q: What is the difference between parameters and hyperparameters?

The parameters the model learns during training are the weights (the slopes, denoted w) and the biases (denoted b), which are adjusted automatically to fit the data. Hyperparameters are values set outside the training loop that you tune yourself, such as how many times you run through the training set and the learning rate, which defines how far the line shifts during each step. Tuning hyperparameters remains more of an art than a science and is an experimental process.

Q: What is the learning rate in machine learning?

The learning rate is a hyperparameter that defines how far the line is shifted during each training step, based on the information from the previous training step. It is one of the values that plays a role in how accurate the model can become and how long training takes. Along with the number of times you run through the training set, adjusting the learning rate is part of hyperparameter tuning, an experimental process that depends on the specifics of your dataset, model, and training process.

Q: What is the TensorFlow Playground used for?

The TensorFlow Playground is a completely browser-based machine learning sandbox where you can experiment with training and parameters. It lets you try different parameters and run training against mock datasets to see how they affect results, and the video notes you cannot break the site. It is recommended as a hands-on way to explore the training and parameter-tuning concepts covered in the seven-step machine learning workflow. It is available at playground.tensorflow.org.

Summary & Key Takeaways

  • Machine learning grants computers new abilities like detecting skin cancer or sorting cucumbers. Yufeng Guo demonstrates the process with a simple example: building a model that determines whether a drink is wine or beer, using it as a framework to explain how answers are extracted from data through training.

  • The first steps are gathering data and preparing it. Data on drink color and alcohol content is collected using a spectrometer and hydrometer, then randomized, visualized for relationships and imbalances, and split into training and evaluation sets so the model cannot simply memorize the questions it was tested on.

  • A linear model is chosen, then trained by adjusting weights and biases so a random line moves step by step toward separating wine and beer. After evaluation on unseen data and hyperparameter tuning, the model is used for prediction, differentiating drinks automatically rather than by human judgment or manual rules.


Read in Other Languages (beta)

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from Google Cloud Tech 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator