DEV Community

Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

AWS DeepRacer student: Machine Learning Basics for model training (Part 1)

Machine learning is a new field created at the intersection of statistics, applied math, and computer science
Image description

Terminology

  1. Machine learning or ML : is a modern software development technique that enables computers to solve problems by using examples of real-world data.

  2. Supervised learning, every training sample from the dataset has a corresponding label or output value associated with it. As a result, the algorithm learns to predict labels or output values.

  3. Reinforcement learning, the algorithm figures out which actions to take in a situation to maximize a reward (in the form of a number) on the way to reaching a specific goal.

  4. Unsupervised learning, there are no labels for the training data. A machine learning algorithm tries to learn the underlying patterns or distributions that govern the data.

Steps followed in ML

Image description

A model is an extremely generic program (or block of code), made specific by the data used to train it. It is used to solve different problems.

Two simple examples
Example 1
Imagine you own a snow cone cart, and you have some data about the average number of snow cones sold per day based on the high temperature. You want to better understand this relationship to make sure you have enough inventory on hand for those high sales days.

Image description

Snow cone
In the graph above, you can see one example of a model, a linear regression model (indicated by the solid line). You can see that, based on the data provided, the model predicts that as the high temperature for the day increases so do the average number of snow cones sold. Sweet!

Example 2
Let's look at a different example that uses the same linear regression model, but with different data and a completely different question to answer.
Imagine that you work in higher education and you want to better understand the relationship between the cost of enrollment and the number of students attending college. In this example, our model predicts that as the cost of tuition increases, the number of people attending college is likely to decrease.

Image description

Student enrollment vs Tuition cost
Using the same linear regression model (indicated by the solid line), you can see that the number of people attending college does go down as the cost increases.
Both examples showcase that a model is a generic program made specific by the data used to train it.

How are model training algorithms used to train a model?
In the preceding section, we talked about two key pieces of information: a model and data. In this section, we show you how those two pieces of information are used to create a trained model. This process is called model training.

Model training algorithms work through an interactive process
Let's revisit our clay teapot analogy. We've gotten our piece of clay, and now we want to make a teapot. Let's look at the algorithm for molding clay and how it resembles a machine learning algorithm:

  • Think about the changes that need to be made. The first thing you would do is inspect the raw clay and think about what changes can be made to make it look more like a teapot. Similarly, a model training algorithm uses the model to process data and then compares the results against some end goal, such as our clay teapot.

  • Make those changes. Now, you mold the clay to make it look more like a teapot. Similarly, a model training algorithm gently nudges specific parts of the model in a direction that brings the model closer to achieving the goal.

  • Repeat. By iterating these steps over and over, you get closer and closer to what you want, until you determine that you’re close enough and then you can stop.

Image description

Summary

  • A model is an extremely generic program, made specific by the data used to train it.

  • Model training algorithms work through an interactive process where the current model iteration is analyzed to determine what changes can be made to get closer to the goal. Those changes are made and the iteration continues until the model is evaluated to meet the goals.

  • Model inference is when the trained model is used to generate predictions.

Top comments (0)