Skip to main content

Fundamentals of ML

Building an ML model involves:

  • collecting data
  • preparing/processing the data
  • selecting an appropriate algorithm
  • feed the prepared data to the algorithm (run/execute)
  • evaluate the performace

Data Collection and Preparation (Training Data)​

The ML process starts with collecting and processing the training data. Bad data is often called garbage in, garbage out. This is the most critical stage in making the whole model work as intended. So, an ML model is only as good as the data used to train it.

There are a several different types of data used in training an ML model. First, it's important to know the difference between labeled and unlabeled data.

Labeled Data​

Labeled data is data that has been tagged with one or more labels. For example, an image of a cat might be labeled as "cat". These labels are typically provided by human experts or obtained through a reliable process.

Labeled data is used in supervised learning, where the model learns to predict the label for new, unseen data.

Unlabeled Data​

Unlabeled data is data that has not been tagged with labels. For example, an image of a cat might not have any label associated with it.

Unlabeled data is used in unsupervised learning, where the model learns to find patterns and relationships in the data without any explicit labels.

The main types of data used in training are structured and unstructured data.

Structured Data​

Structured data is data that is organized in a specific format, such as rows and columns in a table or a database. It is easy to process and analyze using traditional data analysis techniques.

Unstructured Data​

Unstructured data is data that does not have a specific format or organization. It can include text, images, audio, video, and other types of data that are not easily processed using traditional data analysis techniques. Unstructured data often requires more advanced techniques, such as natural language processing or computer vision, to extract useful information.

Labeled/unlabeled and structured/unstructured describe different properties of data. They are independent, so data can fall into any of four combinations:

Data typeLabeledUnlabeled
StructuredA table of customer records with a feedback: good/bad columnA table of customer records without a feedback column
UnstructuredImages tagged “cat” or “dog”; emails marked “spam” or “not spam”A folder of unlabeled images; a collection of raw emails

ML Process (Algorithm)​

The compiled, training data is fed into machine learning algorithms. The ML learning process is traditionally divided into three broad categories: supervised learning, unsupervised learning, and reinforcement learning.

Supervised Learning​

Supervised learning is a type of machine learning where the algorithm is trained on labeled data. The goal is to learn a mapping from input features to output labels, so that the model can predict output/label for new, unseen data.

Unsupervised Learning​

Unsupervised learning is a type of machine learning where the algorithm is trained on unlabeled data. The goal is to find patterns, relationships, or structures in the data without any predefined labels.

Reinforcement Learning​

Reinforcement learning is a type of machine learning where an agent learns to make decisions by interacting with an environment. The agent receives feedback in the form of rewards or penalties based on its actions, and it learns to maximize its cumulative reward over time.

Inferencing​

After the model is trained, it can be used to make predictions or decisions on new, unseen data. This process is known as inferencing or inference.

There are two main types of inferencing in machine learning: batch inferencing and real-time inferencing.

Batch Inferencing​

Batch inferencing is the process of making predictions on a large set of data at once. This type of inferencing is often used for tasks like data analysis, where the speed of the decision-making process is not as crucial as the accuracy of the results.

Real-time Inferencing​

Real-time inferencing is the process of making predictions on individual data points as they arrive. This type of inferencing is often used for tasks like fraud detection or recommendation systems, where the speed of the decision-making process is critical.