makautnotes

0.1 Introduction to Machine Learning: Definition, AI vs ML vs DL★★

Important2/4 recent papersup to 6M⏱ 8 min
PYQs5
  • A machine learning algorithm builds a model based on sample data, known as ______. → Training data 2023-24 1M recent
  • What is Artificial Intelligence and why do we need it? 2022-23 5M recent
  • How is machine learning related to AI? 2022-23 4M recent
  • Differentiate between Artificial Intelligence, Machine Learning and Deep Learning. 2022-23 6M recent
  • Differentiate between Machine Learning and Deep Learning. 2023-24 5M recent

Who Wrote the Rules?


What Is Machine Learning PYQ 1M

Machine learning (ML) is the field in which computers learn patterns from data and improve at a task with experience, instead of following hand-written rules.

Classic definitions

Worked example: a spam filter

Part Spam filter
Task T classify each e-mail as spam or not spam
Performance P % of e-mails classified correctly
Experience E thousands of e-mails already labelled spam / not spam

Training data

flowchart TD
    A["<b>Traditional code</b><br>data + rules"]:::blue --> B["<b>Output</b>"]:::blue
    C["<b>Machine learning</b><br>data + answers"]:::amber --> D["<b>Rules (model)</b><br>learnt"]:::green
    classDef blue fill:#5b84d424,stroke:#5b84d480
    classDef amber fill:#d6a24424,stroke:#d6a24480
    classDef red fill:#d0707024,stroke:#d0707080
    classDef green fill:#52a86e24,stroke:#52a86e80

Artificial Intelligence PYQ 5M

Artificial intelligence (AI) is the science of making machines perform tasks that normally need human intelligence, such as reasoning, understanding language, seeing and deciding. The term was coined by John McCarthy in 1956.

Goals of AI

Why we need AI

  1. Huge data: humans can't analyse billions of records; AI can.
  2. Automation of complex tasks: driving assistance, medical image screening, fraud checks.
  3. Speed and scale: decisions in milliseconds, 24×7.
  4. Accuracy and consistency: no fatigue or mood swings.
  5. Personalisation: recommendations, adaptive learning apps.
  6. Dangerous or repetitive work: robots in mines, space, factories.

Narrow vs general AI


How ML Relates to AI PYQ 4M

Basis Rule-based AI Learning-based AI (ML)
Rules come from human experts data
New situations fails if no rule exists generalises from examples
Improves with data? no yes
Example early medical expert systems modern spam filters

AI vs ML vs DL PYQ 6M

Deep learning (DL) is a subset of ML that uses neural networks with many layers to learn features directly from raw data (→ 4.4).

flowchart TD
    subgraph AI["Artificial Intelligence"]
        direction TB
        a1["machines that act<br>intelligently"]:::blue
        subgraph ML["Machine Learning"]
            direction TB
            m1["learns patterns from data"]:::amber
            subgraph DL["Deep Learning"]
                d1["many-layer neural networks"]:::green
            end
        end
    end
    a1 ~~~ m1
    m1 ~~~ d1
    classDef blue fill:#5b84d424,stroke:#5b84d480
    classDef amber fill:#d6a24424,stroke:#d6a24480
    classDef red fill:#d0707024,stroke:#d0707080
    classDef green fill:#52a86e24,stroke:#52a86e80
    style AI fill:#5b84d414,stroke:#5b84d480
    style ML fill:#d6a24414,stroke:#d6a24480
    style DL fill:#52a86e14,stroke:#52a86e80
Basis AI ML DL
Scope broadest field subset of AI subset of ML
Approach rules, search, logic or learning learns patterns from data multi-layer neural networks
Data needed can work with little moderate very large
Feature engineering not applicable / manual rules mostly manual automatic
Hardware varies ordinary CPU often enough GPUs / TPUs
Interpretability high for rule systems moderate low ("black box")
Examples chess engine, expert system spam filter, loan approval face recognition, speech, chatbots

Applications of Machine Learning

  1. Healthcare: disease prediction from reports, cancer detection in scans.
  2. Finance: fraud detection on card transactions, credit scoring.
  3. E-commerce: product recommendations ("customers also bought").
  4. Computer vision: face unlock, number-plate reading, quality checks in factories.
  5. Speech and language: voice assistants, translation, chatbots.
  6. Autonomous vehicles: detecting lanes, signs and pedestrians.
  7. Spam and malware filtering in e-mail.

Steps to Develop an ML Application

flowchart TD
    A["<b>1 · Define the problem</b><br>goal, success measure"]:::blue --> B["<b>2 · Collect data</b>"]:::blue
    B --> C["<b>3 · Prepare data</b><br>clean, features"]:::amber
    C --> D["<b>4 · Choose a model</b>"]:::amber
    D --> E["<b>5 · Train</b>"]:::amber
    E --> F["<b>6 · Evaluate and tune</b>"]:::amber
    F -.->|"not good enough"| D
    F --> G["<b>7 · Deploy and monitor</b>"]:::green
    classDef blue fill:#5b84d424,stroke:#5b84d480
    classDef amber fill:#d6a24424,stroke:#d6a24480
    classDef red fill:#d0707024,stroke:#d0707080
    classDef green fill:#52a86e24,stroke:#52a86e80
  1. Problem definition: what to predict, and how success is measured (accuracy, error).
  2. Data collection: from databases, sensors, web, surveys.
  3. Pre-processing: handle missing values, remove noise, encode and scale features (→ 0.3).
  4. Feature engineering: choose or create the most useful inputs.
  5. Model selection: pick suitable algorithms (tree, regression, neural network…).
  6. Training: the algorithm learns from the training data.
  7. Evaluation: test on unseen data with suitable metrics (→ 3.1).
  8. Tuning: adjust hyperparameters, try other models (→ 3.4).
  9. Deployment and monitoring: put it into use; retrain when data changes.

Objectives, Design Issues and Approaches

Objectives of ML

Designing a learning system (Mitchell's checkers example)

  1. Choose the training experience: what data the system learns from (games played against itself).
  2. Choose the target function: what exactly to learn (the value of a board position).
  3. Choose its representation: how to express it (a weighted sum of board features).
  4. Choose the learning algorithm: how to adjust it (update weights to reduce error).

Design issues

Approaches


Can Every Problem Be Solved by ML?

No. ML fits only some problems.

When ML fits

When ML does not fit

⚡ Quick recall
  • ML? → computers learn patterns from data, improving with experience · Samuel 1959 · Mitchell T, P, E
  • Model built from sample data? → training data
  • AI? → machines doing tasks needing human intelligence · McCarthy 1956 · narrow vs general
  • Why AI? → huge data · automation · speed · accuracy · personalisation · dangerous work
  • ML and AI? → ML is the data-driven subset of AI · learns rules instead of being given them
  • AI vs ML vs DL? → nested: AI ⊃ ML ⊃ DL · DL = many-layer neural networks, big data, GPUs, automatic features
  • Steps? → define → collect → prepare → features → choose model → train → evaluate → tune → deploy
  • Design? → training experience · target function · representation · learning algorithm
  • All problems by ML? → no: not for exact-rule, no-data, must-be-perfect or random problems
Unit 0 · 0/4