Header Ads

Short Explanation on Common algorithms used in Machine Learning

Here's a concise explanation of the algorithms mentioned for each type of machine learning.


Supervised Learning Algorithms

1. Linear Regression

Purpose: Predict a continuous numerical value.

  • Finds the best-fit straight line through data.
  • Used when the output is a number.

Example:

  • Predict house prices
  • Predict salary based on years of experience

2. Logistic Regression

Purpose: Classification (usually Yes/No).

  • Predicts the probability that an input belongs to a class.
  • Despite the name, it is mainly used for classification.

Example:

  • Spam or Not Spam
  • Disease or No Disease

3. Decision Tree

Purpose: Classification and Regression.

  • Makes decisions using a tree-like structure of questions.
  • Easy to understand and interpret.

Example:

Is Age > 18?
        │
   Yes      No
   │         │
Income >50K? Reject

Applications

  • Loan approval
  • Medical diagnosis

4. Random Forest

Purpose: Improve Decision Tree accuracy.

  • Combines many decision trees.
  • Final prediction is based on majority voting (classification) or averaging (regression).

Advantages

  • More accurate
  • Less prone to overfitting

Applications

  • Fraud detection
  • Customer churn prediction

5. Support Vector Machine (SVM)

Purpose: Classification.

  • Finds the best boundary (hyperplane) that separates different classes.

Example:

Cats ● ● ● | Dogs ▲ ▲ ▲

The line between them is chosen to maximize the margin between classes.

Applications

  • Face recognition
  • Text classification

6. Neural Networks

Purpose: Learn complex relationships in data.

  • Inspired by the human brain.
  • Consists of layers of interconnected artificial neurons.
  • Foundation of Deep Learning.

Applications

  • Image recognition
  • Speech recognition
  • Language translation

Unsupervised Learning Algorithms

1. K-Means Clustering

Purpose: Group similar data into K clusters.

Example:

Customers grouped into:

  • Budget buyers
  • Premium buyers
  • Occasional buyers

The value of K (number of clusters) is chosen before training.


2. Hierarchical Clustering

Purpose: Build a hierarchy of clusters.

  • Starts by treating each data point as its own cluster.
  • Gradually merges similar clusters.
  • Produces a tree-like diagram (dendrogram).

Applications

  • Gene analysis
  • Document clustering

3. DBSCAN

Purpose: Density-based clustering.

  • Groups densely packed points together.
  • Detects outliers as noise.
  • Does not require specifying the number of clusters beforehand.

Applications

  • GPS location clustering
  • Fraud detection
  • Anomaly detection

4. PCA (Principal Component Analysis)

Purpose: Reduce the number of features while preserving most of the important information.

Example:

100 features → 10 important features

Benefits

  • Faster training
  • Easier visualization
  • Reduced storage

5. Autoencoders

Purpose: Learn a compact representation of data using neural networks.

  • Compresses data into a smaller form (encoding).
  • Reconstructs the original data from the compressed representation.

Applications

  • Image compression
  • Denoising images
  • Anomaly detection

Reinforcement Learning Algorithms

1. Q-Learning

Purpose: Learn the best action for each situation.

  • Builds a Q-table that stores the expected reward for taking a specific action in a given state.
  • Chooses actions that maximize future rewards.

Applications

  • Robot navigation
  • Simple games

2. Deep Q Network (DQN)

Purpose: Solve larger problems where a Q-table becomes impractical.

  • Replaces the Q-table with a deep neural network to estimate Q-values.
  • Can handle high-dimensional inputs such as images.

Applications

  • Atari games
  • Self-driving simulations

3. SARSA (State-Action-Reward-State-Action)

Purpose: Similar to Q-Learning but updates based on the action actually taken.

  • Learns a safer, more conservative policy because it accounts for the agent's current behavior.

Applications

  • Robotics
  • Navigation systems

4. PPO (Proximal Policy Optimization)

Purpose: Train agents while keeping policy updates stable.

  • A modern reinforcement learning algorithm that prevents excessively large updates, improving reliability.

Applications

  • Robotics
  • Autonomous vehicles
  • Large-scale game AI

5. Actor-Critic Methods

Purpose: Combine two models to improve learning.

  • Actor: Chooses which action to take.
  • Critic: Evaluates how good that action was and provides feedback.

Together, they learn more efficiently than using a single model.

Applications

  • Robotics
  • Industrial automation
  • Advanced game AI

Quick Summary Table

AlgorithmLearning TypeMain PurposeExample Use
Linear RegressionSupervisedPredict numbersHouse price prediction
Logistic RegressionSupervisedBinary classificationSpam detection
Decision TreeSupervisedRule-based decisionsLoan approval
Random ForestSupervisedMore accurate ensemble predictionFraud detection
SVMSupervisedFind best class boundaryFace recognition
Neural NetworksSupervised/Deep LearningLearn complex patternsImage recognition
K-MeansUnsupervisedGroup similar dataCustomer segmentation
Hierarchical ClusteringUnsupervisedBuild cluster hierarchyGene analysis
DBSCANUnsupervisedDensity-based clusteringGPS clustering
PCAUnsupervisedReduce feature dimensionsData visualization
AutoencodersUnsupervisedData compression & feature learningImage denoising
Q-LearningReinforcementLearn action valuesRobot navigation
Deep Q Network (DQN)ReinforcementQ-learning with deep neural networksVideo game AI
SARSAReinforcementOn-policy action learningSafe navigation
PPOReinforcementStable policy optimizationRobot control
Actor-CriticReinforcementPolicy + value learningAutonomous driving

Rule of thumb:

  • Regression algorithms predict numbers.
  • Classification algorithms predict categories.
  • Clustering algorithms group similar data.
  • Dimensionality reduction algorithms simplify data while preserving information.
  • Reinforcement learning algorithms learn the best actions through rewards and penalties.