Machine Learning Methods, Models and Algorithms - tech9tel/ai GitHub Wiki

๐Ÿง  Method โ†’ Model โ†’ Algorithm

  • Method
    The broad approach to learning.
    Example: Supervised Learning

  • Model
    The structure or framework built using the method.
    Example: Decision Tree

  • Algorithm
    The specific mathematical procedure or technique used to train or construct the model.
    Example: ID3, CART


๐Ÿ“˜ AI/ML Methods โ†’ Models โ†’ Algorithms Mapping

๐Ÿ” Method ๐Ÿง  Model โš™๏ธ Algorithm
Supervised Learning Linear Regression Ordinary Least Squares
Logistic Regression Maximum Likelihood Estimation
Decision Tree CART / ID3 / C4.5
Random Forest Ensemble of Decision Trees
Support Vector Machine (SVM) Kernel Trick + Optimization
K-Nearest Neighbors (KNN) Distance-Based Search
Naive Bayes Classifier Bayesโ€™ Theorem
Neural Network Backpropagation
CNN (Convolutional NN) Convolution + Pooling + Dense
RNN (Recurrent NN) Backpropagation Through Time (BPTT)
LSTM Gated RNNs
Unsupervised Learning K-Means Clustering Lloydโ€™s Algorithm
Hierarchical Clustering Agglomerative / Divisive
PCA (Dimensionality Reduction) Eigen Decomposition
DBSCAN Density-Based Clustering
Autoencoder Encoder-Decoder
GAN (Generative Adversarial) Generator + Discriminator Game
Reinforcement Learning Q-Learning Value Iteration
DQN (Deep Q-Network) Q-Learning + Neural Networks
PPO Policy Optimization
Self-Supervised Learning BERT Masked Language Modeling
SimCLR Contrastive Loss
Generative / Deep Learning GPT Transformer Decoder + Language Loss

๐ŸŽฏ Algorithm vs Method


๐Ÿง  Algorithm

๐Ÿ’ก Definition:
A step-by-step, rule-based procedure to solve a specific problem or complete a task.

๐Ÿ” Example:
๐Ÿงฎ Merge Sort โ€“ An algorithm that divides the list, sorts parts, and merges them.

๐Ÿ“Œ Key Highlights:

  • ๐Ÿงพ Clear sequence of instructions
  • โš™๏ธ Designed to transform input into desired output
  • ๐Ÿ” Repeatable and predictable

๐Ÿ› ๏ธ Method

๐Ÿ’ก Definition:
A general technique or approach used to solve a class of problems, often involving one or more algorithms.

๐Ÿ” Example:
๐Ÿ“‰ Gradient Descent โ€“ A method for minimizing loss functions in ML using different algorithm variants like SGD or Batch GD.

๐Ÿ“Œ Key Highlights:

  • ๐Ÿงญ Broader in scope than algorithms
  • ๐Ÿ”ง Can include multiple algorithms
  • ๐Ÿงช Often used in practical applications and model training

๐Ÿ†š Key Differences

Aspect ๐Ÿงฎ Algorithm ๐Ÿ› ๏ธ Method
๐Ÿ“˜ Definition Specific step-by-step process General approach/technique
๐Ÿ” Scope Narrow, problem-specific Broad, task-oriented
๐Ÿงฑ Examples Merge Sort, K-Means, A* Search Gradient Descent, Supervised Learning
โš™๏ธ Relationship Can be part of a method May use multiple algorithms

๐Ÿ”— How They Work Together in ML

  • Method: Supervised Learning ๐Ÿง‘โ€๐Ÿซ
  • Algorithm: Decision Tree, SVM, or Linear Regression ๐ŸŒณ๐Ÿ“Š

๐Ÿงต In Summary:

  • ๐ŸŽฒ Algorithm = Exact steps ๐Ÿงฎ
  • ๐Ÿงฐ Method = General strategy, may use algorithms ๐Ÿ› ๏ธ

๐Ÿ”— Think of a method as a toolbox ๐Ÿงฐ, and each algorithm is a tool ๐Ÿงฒ you pick based on the task!


๐Ÿค– Algorithm vs Model


๐Ÿ” Algorithm

  • A step-by-step procedure or set of rules used to solve a problem or perform a task.
  • In AI/ML, an algorithm is used to train a model.
  • Think of it like a recipe.

๐Ÿงช Example: Linear Regression algorithm tells you how to find the best-fitting line.


๐Ÿง  Model

  • The output or result of running an algorithm on data.
  • Itโ€™s the trained representation that can make predictions or decisions.
  • Think of it like the dish made using the recipe.

๐ŸŽฏ Example: The linear equation y = 3x + 2 is a model learned by applying the linear regression algorithm to your data.


โšก Analogy Table

Concept Analogy
Algorithm ๐Ÿณ Cooking recipe
Model ๐Ÿฝ๏ธ Final dish (after cooking)
Method โ†’ Model โ†’ Algorithm