Architectures and Applications of Artificial Intelligence
Machine Learning Paradigms
Supervised Learning: The Guided Path
In supervised learning, the goal is to learn a mapping function that turns an input variable (X) into an output variable (Y). The model is trained on a dataset where the “correct answers” (labels) are already known. Its task is to get as close to these answers as possible.
The core of this process is measuring error. A loss function quantifies the difference between the model’s prediction and the actual label. For a regression problem, a common choice is Mean Squared Error (MSE), which penalizes larger errors more heavily.
Minimizing this loss is the objective. The most common optimization algorithm for this is gradient descent. Think of the loss function as a hilly landscape. The model’s current parameters place it somewhere on that landscape, and the goal is to find the lowest valley. Gradient descent calculates the slope (gradient) at the current position and takes a step downhill.
This step-by-step adjustment is repeated iteratively, guided by a learning rate that determines the size of each step. The process continues until the model's parameters converge on a point where the loss is minimal. In neural networks, the gradient is calculated and distributed through the network using an algorithm called backpropagation., which efficiently adjusts the weights of each connection to reduce the overall error.
Here's the gradient descent update rule in its basic form:
Unsupervised Learning: Finding Structure
Unsupervised learning operates on data without any labels. The objective isn't to predict a specific output, but to find hidden patterns or intrinsic structure within the data itself. The two primary tasks are clustering and dimensionality reduction.
Clustering algorithms group data points based on similarity. One of the most well-known methods is K-Means, which partitions data into a pre-specified number (K) of clusters. It works by iteratively assigning each data point to the nearest cluster center (centroid) and then recalculating the centroid's position based on the mean of the points assigned to it. The underlying principle is geometric proximity: points that are close to each other in the feature space are assumed to be related.
Dimensionality reduction simplifies data by reducing the number of random variables, or features, under consideration. This is useful for visualization, noise reduction, and improving the efficiency of other ML algorithms. It works by transforming the data from a high-dimensional space into a lower-dimensional one while retaining meaningful properties.
A key technique for this is Principal Component Analysis (PCA), which identifies the directions (principal components) along which the data has the most variance. By projecting the data onto a smaller number of these components, we can capture most of the essential information in fewer dimensions.
Reinforcement Learning: Learning by Doing
Reinforcement Learning (RL) takes a different approach. It involves an agent that learns to make decisions by performing actions in an environment to achieve a goal. Instead of being given correct labels, the agent receives feedback in the form of rewards or penalties.
The interaction is a continuous loop: the agent observes the state of the environment, takes an action, receives a reward, and enters a new state. The objective is to learn a policy—a mapping from states to actions—that maximizes the cumulative reward over time. This process is often formalized as a (MDP).
The reward structure is crucial. A sparse reward, like winning or losing a game of chess, provides feedback only at the end of a long sequence of actions. This makes it difficult for the agent to know which moves were good. A dense reward, given after every step, provides more frequent guidance but can sometimes lead the agent to optimize for short-term gains at the expense of the long-term goal.
Choosing the right paradigm depends entirely on the data available and the problem you want to solve. If you have labeled data and a clear target to predict, supervised learning is the way to go. If you have unlabeled data and want to discover its underlying structure, use unsupervised methods. And if your problem involves an agent making decisions in an interactive environment, reinforcement learning provides the framework.
What is the primary goal of supervised learning?
In the context of training a machine learning model, what is the role of a loss function?

