Personal tools

ML Techniques (Supervised, Unsupervised, Reinforcement)

Different Machine Learning Models_010924A
[Different Machine Learning Models - Deepika Yadav]

 Machine Learning: 

Algorithms that parse data, learn from that data, 

and then apply what they’ve learned to make informed decisions

 
 
 

- Overview

Machine intelligence is the last invention that humanity will ever need to make. If you could look back a couple of years ago at the state of artificial intelligence (AI) and compare it with its current state, you would be shocked to find how exponentially it has grown over time. It has branched out into a variety of domains such as machine learning (ML), expert systems, natural language processing (NLP), and dozens more.  

While the idea behind AI is to build smarter systems that think and execute on their own, they still need to be trained. The ML domain of AI has been created for the very exact purpose by bringing several algorithms, allowing for smoother data processing and decision-making. 

Machine learning is a subset of artificial intelligence (AI) that uses statistical algorithms to learn patterns from training data and make predictions or decisions without explicit, hard-coded rules. 

Core Concept:

  • No explicit programming: Instead of writing step-by-step logic for a task, developers feed data into an algorithm so the system discovers rules and patterns on its own.
  • Generalization: The main goal is to perform well on unseen real-world data, not just memorize the training dataset.
  • Model and Algorithm: An algorithm is the mathematical procedure or logic, while a model is the output program trained on data to handle predictions. 

 

Please refer to the following for more details:  

 

- Machine Learning (ML) vs. Artificial Intelligence (AI)

Artificial Intelligence (AI) is the broad science of building systems that mimic human intelligence, while Machine Learning (ML) is a specific subset of AI where computers learn patterns from data rather than following hard-coded rules. 

(A) Key Differences:

  • The Relationship: All machine learning is AI, but not all AI is machine learning. AI can include simple rule-based logic, expert systems, and hard-coded decision trees, whereas ML strictly relies on data-driven training.
  • The Goal vs. The Method: AI is the overall goal or product (making a machine act intelligently), while ML is a core method or engine used to achieve that intelligence.

 

(B) How They Work:

  • AI can use logic loops, hard-coded rules, or symbolic reasoning.
  • ML uses statistical algorithms and training datasets to continuously find patterns and improve predictions on its own.

 

(C) Quick Comparison: 

1. Scope:

  • AI: The massive umbrella term for any computer system mimicking human behavior.
  • ML: A specific subset focused strictly on data-driven learning models.

2. Programming:

  • AI: Can be explicitly programmed with static rules or logic.
  • ML: Learns and adapts automatically from examples and data.

3. Examples:

  • AI: Old-school rule-based chatbots, chess programs, or full autonomous systems.
  • ML: Fraud detection, recommendation engines, and predictive analytics.

 

 - Types of Machine Learning

Machine learning (ML) divides into three primary paradigms based on how algorithms interact with data and feedback:

(A) Supervised Learning: 

1. Definition: The model trains on a labeled dataset where each input is paired with the correct output.

2. Core Tasks:

  • Classification: Predicts discrete categories (e.g., spam vs. not spam, cat vs. dog).
  • Regression: Predicts continuous numerical values (e.g., house prices, temperature).

3. Common Algorithms: Linear/Logistic Regression, Support Vector Machines (SVM), Decision Trees, Random Forests, Neural Networks.

4. Applications: Medical diagnosis, credit card fraud detection, weather forecasting.

(B) Unsupervised Learning:

1. Definition: The model analyzes unlabeled data without predefined answers to discover hidden structures or patterns on its own. 

2. Core Tasks:

  • Clustering: Groups similar data points together (e.g., customer segmentation).
  • Association & Dimensionality Reduction: Finds rules connecting variables or simplifies complex data (e.g., Principal Component Analysis, Apriori). 

3. Common Algorithms: K-Means, Hierarchical Clustering, DBSCAN, PCA, Autoencoders. 

4. Applications: Customer profiling, anomaly/fraud detection, recommendation engines.


(C) Reinforcement Learning (RL):

1. Definition: An agent learns to make decisions by interacting with a dynamic environment through trial and error, guided by rewards and penalties. 

2. Core Approach: No static training dataset is provided; the agent optimizes its long-term strategy (policy) to maximize cumulative rewards. 

3. Common Algorithms: Q-Learning, Deep Q-Networks (DQN), SARSA. 

4. Applications: Autonomous/self-driving vehicles, robotic motion control, game-playing AI (e.g., AlphaGo).

 

- The Different Purposes of ML Algorithms and Models

There are several distinct types of Machine Learning (ML) - including supervised learning, unsupervised learning, deep learning, and reinforcement learning - each designed for a specific purpose. 

  • Supervised learning uses labeled examples to map inputs to known outputs. Its primary purpose is to learn the relationship between features and target labels so the model can predict outcomes on new, unseen data.
  • Unsupervised learning works with unlabeled data, meaning the model only receives input features without predefined answers. Its purpose is to uncover hidden patterns, group similar data points, or identify the underlying structure of a dataset.
  • Deep learning uses multi-layered artificial neural networks to learn complex representations from large amounts of data. Rather than simply analyzing basic trends, it excels at processing unstructured data—such as images, text, and audio—across supervised, unsupervised, and reinforcement learning tasks.
  • Reinforcement learning centers on an agent continuously interacting with a dynamic, uncertain environment. Instead of relying on static datasets, the agent learns by trial and error, receiving feedback in the form of rewards or penalties. Because rewards are often delayed - arriving several steps after an action is taken - the agent must continually adapt its policy over time to maximize long-term cumulative rewards.

 

- How Does Machine Learning Work?

Machine learning (ML) is a subfield of artificial intelligence (AI) where computers learn to recognize patterns and make decisions from data without being explicitly programmed with hard-coded rules. 

The “learning” in ML refers to a process in which machines review existing data and learn new skills and knowledge from that data. ML systems use algorithms to find patterns in datasets, which might include structured data, unstructured textual data, numeric data, or even rich media like audio files, images and videos. 

ML algorithms are computationally intensive, requiring specialized infrastructure to run at large scale. 

Suppose we have to train a model that can recognize the given data (image) as a cat or a dog. We will use tag (definition) input. We each took thousands of photos of cats and dogs. 

After that, we will do feature extraction. This means that we have to extract features (e.g. color, eyes, nose, ears, etc.) from the raw input that defines or can distinguish between cats and dogs. 

How the Machine Learning (ML) Process Works: 

Machine learning (ML) works through a core cycle of feeding data into algorithms, building a mathematical model, and testing its accuracy:

  • Data Collection and Cleaning: The system gathers large amounts of raw data (such as images, text, or sensor readings) and cleans it to remove errors or noise. 
  • Training with Algorithms: An algorithm (a set of mathematical instructions) processes the data. It adjusts its internal settings - called weights or parameters - to minimize mistakes and find hidden patterns. 
  • Model Creation: The output of training is a model, which acts like a custom function. When given new information, the model uses what it learned to make a prediction or classification. 
  • Evaluation and Testing: The model is tested using separate data it has never seen before to check how well it performs.

 

- Machine Learning Algorithms and Models

A machine learning (ML) algorithm is the mathematical procedure or "recipe" used to find patterns in data, while a machine learning model is the specific output - the trained rules, weights, and structures—produced after running that algorithm on a dataset. 

Machine learning (ML) involves the use of ML algorithms and models. The aim is to go from data to insight. 

For example, if an online retailer wants to anticipate sales for the next quarter, they might use a ML algorithm that predicts those sales based on past sales and other relevant data. 

Similarly, a windmill manufacturer might visually monitor important equipment and feed the video data through algorithms trained to identify dangerous cracks.  

  • ML algorithms are procedures that are implemented in code and are run on data.
  • ML models are output by algorithms and are comprised of model data and a prediction algorithm.
  • ML algorithms provide a type of automatic programming where ML models represent the program.

 

1. Algorithms vs. Models:

  • The Algorithm (The Process). The step-by-step mathematical logic (such as gradient descent or decision tree splitting) that processes training data to minimize errors and learn patterns.
  • The Model (The Result). The saved artifact produced after training. It contains the learned parameters (like weights in a neural network or coefficients in a regression equation) used to make predictions on new, unseen data.


2. Deep Learning & Modern Architectures: 

Deep learning (DL) is a specialized subset of machine learning (ML) that uses multi-layered Artificial Neural Networks (ANNs) to automatically extract features from complex, unstructured data. 

  • Convolutional Neural Networks (CNNs). Designed to process grid-like data such as images and video for object detection and facial recognition.
  • Recurrent Neural Networks (RNNs) & LSTMs. Built for sequential data like time-series forecasting and speech.
  • Transformers. The foundational architecture behind modern Large Language Models (LLMs) and multimodal AI, using self-attention mechanisms to process text, code, and images at scale.

Istanbul_Turkey_060421A
[Istanbul, Turkey - Civil Engineering Discoveries]

- Four Types of ML Algorithms

Machine learning (ML) algorithms are classified into 4 types: Supervised Learning, Unsupervised Learning, Semi-supervised Learning, and Reinforcement Learning. 

  • Supervised Learning Algorithm: This algorithm consists of a target/outcome variable (or dependent variable) which is to be predicted from a given set of predictors (independent variables). Using these set of variables, we generate a function that map inputs to desired outputs. The training process continues until the model achieves a desired level of accuracy on the training data. Examples of Supervised Learning: Regression, Decision Tree, Random Forest, KNN, Logistic Regression etc.
  • Unsupervised Learning Algorithm: In this algorithm, we do not have any target or outcome variable to predict / estimate. It is used for clustering population in different groups, which is widely used for segmenting customers in different groups for specific intervention. Examples of Unsupervised Learning: Apriori algorithm, K-means.
  • Semi-supervised Learning Algorithm: Semi-supervised learning (SSL) is a learning problem that involves a small number of labeled examples and a large number of unlabeled examples. This type of learning problem is challenging because neither supervised nor unsupervised learning algorithms can effectively utilize the mixture of labeled and uninterpretable data. Therefore, specialized semi-supervised learning algorithms are required. Therefore, this is a learning problem between supervised and unsupervised learning. SSL is somewhere between supervised and unsupervised learning. In addition to unlabeled data, the algorithm also provides some supervision information - but not necessarily for all examples. Often this information will be the target associated with some samples. We need SSL algorithms when working with data where labeling examples is challenging or expensive. 
  • Reinforcement Learning Algorithm: Using this algorithm, the machine is trained to make specific decisions. It works this way: the machine is exposed to an environment where it trains itself continually using trial and error. This machine learns from past experience and tries to capture the best possible knowledge to make accurate business decisions. Example of Reinforcement Learning: Markov Decision Process.

 

Other machine learning techniques include:

  • Clustering: A machine learning technique that groups similar data pieces into clusters. This helps machine learning engineers detect patterns and structures when working with unlabeled data.
  • Decision tree: A popular method of machine learning that uses decision trees to create models that predict outcomes or classify data into categories.
  • Dimensionality reduction: A technique used to reduce the number of features or dimensions in a dataset, while retaining as much information as possible.
  • Ensemble methods: A technique that combines several base models to produce one optimal predictive model.
  • Convolutional neural network: A widely used machine learning technique, mainly in vision-related applications.

 

- Supervised vs. Unsupervised learning

Supervised learning trains models on labeled data to predict known outcomes, while unsupervised learning analyzes unlabeled data to find hidden patterns or structures. 

(A) Key Differences:

  • Training Data: Supervised learning uses input-output pairs with known answers. Unsupervised learning uses raw inputs without labels or target answers.
  • Primary Goal: Supervised learning predicts values or assigns categories on new data. Unsupervised learning explores data to uncover groupings, relationships, or anomalies.
  • Human Effort: Supervised learning demands upfront effort to create accurate labels. Unsupervised learning requires less labeling upfront, but more human effort to interpret and validate results.
  • Evaluation: Supervised models are scored directly against known answers (such as accuracy, precision, recall, or RMSE). Unsupervised models are harder to evaluate objectively because there is no ground-truth label.


(B) Common Tasks and Examples: 

1. Supervised Learning: 

  • Classification (predicting categories): Spam email detection, image recognition, medical diagnosis.
  • Regression (predicting continuous numbers): House prices, sales forecasts, revenue projections.
 

2. Unsupervised Learning:

  • Clustering (grouping similar items): Customer segmentation, organizing documents.
  • Dimensionality reduction & association: Compressing features, removing noise, market basket analysis, anomaly detection.


(C) Choosing Between Them: 

Use supervised learning when you have labeled historical data and need clear predictions or classifications. Use unsupervised learning when your data lacks labels and you want to explore underlying structures or spot unusual behavior. 

Many workflows combine both - such as clustering data first or using semi-supervised learning when labels are scarce. 

The core difference between the two approaches lies in the training data: 

  • Supervised learning uses labeled datasets, meaning each input comes paired with the correct answer (the output variable). The model learns from this historical experience to predict outputs for new inputs. Two primary techniques are regression (predicting continuous values) and classification (sorting data into specific categories). For example, a service business might use supervised learning to predict how many new users will sign up next month based on past trends.
  • Unsupervised learning uses unlabeled datasets, meaning only input data is provided with no target variable to predict. Instead, the algorithm evaluates data points by their traits to discover hidden patterns on its own. Two common techniques are clustering and association. For example, a retailer might use clustering to group products with similar characteristics into distinct segments without defining those groups in advance.

 

[More to come ...]


Document Actions