Skip to content
Plurafy

Machine Learning

Machine learning is a branch of artificial intelligence that teaches computers to learn from data and make predictions without being explicitly programmed for every task.

Instead of writing hard-coded rules, programmers feed data into mathematical algorithms so the system can discover patterns and build its own logic. The process involves,

  • Gathering and cleaning data.
  • Selecting features.
  • Training the model.
  • Evaluating its performance.
  • Deploying it into a real-world service.

Examples of Machine Learning:

  • Recommendation engines suggesting movies or products on platforms like Netflix or Amazon.
  • Fraud detection identifying suspicious transactions in banking.
  • Autonomous driving powering self-driving car perception and driver-assistance features.
  1. Supervised Learning
  2. Unsupervised Learning
  3. Reinforcement Learning

Supervised learning is a machine learning technique where an algorithm trains on a labeled dataset. Meaning every input data point is paired with the correct output label, allowing the system to learn the underlying relationship between them and accurately predict outcomes for new, unseen data.

Think of it like a student studying for an exam with an answer key, where the teacher corrects their mistakes until they understand the patterns.

How the supervised learning process works

  1. Data Collection & Labelling: Gather historical data where final answer or target variable is already known(e.g., historical house sales with thier sale prices).
  2. Model Training: Feed the labeled dataset into an algorithm, which compares its own predictions to the true labels and adjusts its internal parameters to reduce errors.
  3. Validation & Testing: Evaluate the trained model using a separate testing dataset it has never seen before to measure how well it generalizes.
  4. Deployment: Use the validated model in production to predict outcomes for incoming, unlabeled real-world data.

Classification vs. Regression Supervised learning tasks are split into two primary categories depending on the nature of the target output:

Metric / Feature Classification Regression
Output Type Discrete categories or classes Continuous numerical valuesPrimary Goal
Evaluation Metric Accuracy, Precision, F1-score Mean Squared Error (MSE), RMSE
Common Example Detecting whether an email is spam or safe Predicting a home’s selling price

Common Supervised Learning Algorithms

  • Linear Regression: A foundational regression algorithm that fits a straight line to data points to predict continuous values like temperature or stock trends.
  • Logistic Regression: Despite its name, this is a classification algorithm used to predict binary outcomes, such as whether a patient has a disease (yes or no).
  • Decision Trees & Random Forests: Hierarchical structures that split data down branching paths based on specific feature conditions; Random Forests combine many decision trees for higher accuracy.
  • Support Vector Machines (SVM): An algorithm that finds an optimal boundary line (or hyperplane) to separate different classes of data points cleanly.

Real World Examples:

  • Analyzing patient scans or medical history records (frequently benchmarked via resources like the National Institutes of Health) to classify tumors as benign or malignant.
  • Detecting fraudulent credit card transactions in real-time by evaluating transaction patterns against known fraud signatures.
  • Forecasting future product demand and sales volume based on seasonal trends and past purchasing history.

Unsupervised learning is a machine learning technique where an algorithm analyzes unlabeled data to discover hidden patterns, similarities, or structures on its own without human intervention or predefined correct answers.

Instead of matching inputs to known output labels, the system groups or transforms the raw data based on inherent mathematical properties.

Think of it like a student studying without an answer key, discovering patterns, groups, and relationships in the study material on their own.

Core Types of Unsupervised Tasks

  • Clustering: Grouping similar data points based on shared features.
  • Association Rules: Finding “if-then” relationships between variables.
  • Dimensionality Reduction: Reducing the number of variables while keeping critical info.

Common Unsupervised Learning Algorithms:

  • K-Means Clustering: Divides data points into a specific number (K) of flat groups by minimizing the distance to central points called centroids.
  • Hierarchical Clustering: Builds a tree-like hierarchy of clusters by successively merging smaller groups or splitting larger ones.
  • DBSCAN: Identifies dense clusters of arbitrary shapes and treats isolated points as noise or outliers.
  • Principal Component Analysis (PCA): A dimensionality reduction tool that transforms large data variables into smaller, uncorrelated components.
  • Apriori Algorithm: A rule-based approach used to uncover item associations in large transaction records.

Real World Examples:

  • Retailers group customers by behavior to launch tailored marketing campaigns.
  • Cybersecurity tools flag unusual network traffic or fraudulent credit card activity that deviates from normal baselines.
  • Streaming services group user preferences to suggest movies or music.

Reinforcement learning (RL) is a machine learning technique where an autonomous software or robotic agent learns to make optimal decisions by interacting with an environment through trial and error, aiming to maximize a cumulative reward signal over time.

Rather than relying on rigid human-coded rules or static datasets, the agent improves its behavior dynamically based on realtime feedback.

Think of it like a student learning through trial and error, receiving rewards for good decisions and penalties for mistakes, gradually learning the best strategy.

Core Components of Reinforcement Learning RL interactions are modeled using the framework of a Markov Decision Process (MDP), which relies on these foundational elements:

Let’s think of a real world example e.g., “Self driving car”

  • Agent: The learner or decision maker executing actions(The self driving software system).
  • Environment: The external space or world the agent interacts with(The road, other vehicles, and pedestrians).
  • State(s): The current condition or status of the agent and environment(Current speed, lane position, and traffic light color).
  • Action(s): The choice or move made by the agent at a given state(Turning the steering wheel, braking, or accelerating).
  • Reward(s): The feedback signal indicating success or penalty(Positive reward for safe driving and penalty for a collision).

The Exploration vs. Exploitation Dilemma

A defining challenge in reinforcement learning is balancing two competing strategies:

  • Exploration: Trying random or brand-new actions to discover potentially better strategies, even if they result in short-term penalties.
  • Exploitation: Choosing the action known to yield the highest reward based on past experience to optimize immediate success.

Imagine you are trying to find the best lunch spot in your city:

  • Exploitation: You go to your favorite local restaurant every day. You know the food is good, but you will never know if a better option is right around the corner.
  • Exploration: You visit a brand-new, random restaurant every day. You might discover an incredible meal, or you might waste money on a terrible dish.
  • The Balance: You eat at your favorite spot most days to enjoy a good meal, but occasionally try a new place to see if it is better.

Popular Strategies to Solve the Dilemma Reinforcement learning models and decision algorithms use specific mathematical methods to manage this trade-off:

  1. Epsilon-Greedy Strategy: The algorithm chooses the best-known action most of the time, but with a small probability (epsilon), it picks a completely random action to explore new possibilities. Over time, this exploration rate often decreases as the model becomes confident.
  2. Upper Confidence Bound (UCB): This method selects actions by looking at both the average reward and the uncertainty of each choice. If an action has not been tried often, its uncertainty score is high, forcing the algorithm to explore it until its value is known.
  3. Thompson Sampling: A probabilistic approach rooted in Bayesian statistics. It samples choices based on the probability that they are optimal, naturally exploring options with high uncertainty while favoring promising ones.

Common Reinforcement Learning Algorithms

  • Q-Learning: A model-free algorithm that builds a table (Q-table) of expected future rewards for every state-action pair.
  • Deep Q-Networks (DQN): Replaces traditional Q-tables with deep neural networks to handle massive or continuous state spaces, famously used to master Atari games.
  • Policy Gradients: Directly optimizes the agent’s behavior strategy (policy) by mapping probabilities of actions rather than calculating state values.
  • Proximal Policy Optimization (PPO): A stable, widely used policy gradient method powering modern complex robotics and language model alignment.

Real World Examples

  • Google use deep reinforcement learning via DeepMind to control data center cooling systems, cutting energy waste by up to 40% by learning how fan speeds and ventilation affect temperatures in real time.
  • Netflix use RL to decide what shows or movies to display on your homepage, balancing popular titles with new suggestions based on whether you click, watch, or skip.