NCO (Cyber Olympiad) /Digital Ethics & Emerging Technologies

Machine Learning (ML) Basics

Emerging Technologies - AI & ML · free study notes · Updated

Machine Learning (ML) Basics

NCO – Cyber Olympiad
Digital Ethics & Emerging Technologies

Machine Learning is a sub‑field of artificial intelligence that enables computers to learn patterns from data, make predictions, or take actions without being explicitly programmed for every scenario.


1. Simple Explanation

  1. What it is

    • ML algorithms learn from examples (training data).
    • Once trained, they can generalise to new, unseen data.
  2. Why it matters

    • Powers recommendation engines, autonomous vehicles, fraud detection, etc.
    • Can amplify bias or privacy risks if not handled responsibly.
  3. Core Components

    • Data – raw input (images, text, numbers).
    • Model – mathematical function mapping input to output.
    • Training – iteratively adjusting the model to minimise error.
    • Evaluation – measuring performance on unseen data.
    • Deployment – putting the model into real‑world use.

2. Key Points

Concept What It Means Typical Terminology
Supervised Learning Learning with labelled data (input → correct output). Regression, Classification
Unsupervised Learning No labels; discover hidden structure. Clustering, Dimensionality Reduction
Overfitting vs. Underfitting Over‑training on noise vs. too simple a model. Bias‑Variance Tradeoff
Training / Validation / Test Sets Separate data splits to train, tune, and evaluate. Cross‑validation, Hold‑out
Loss Function Numeric measure of error; guides optimisation. Mean Squared Error, Cross‑Entropy
Gradient Descent Optimisation method moving model parameters downhill. Stochastic, Mini‑batch
Regularisation Penalise complexity to avoid over‑fitting. L1, L2, Dropout
Feature Engineering Selecting/transforming inputs to improve learning. Normalisation, One‑hot
Bias & Fairness Systematic errors that can discriminate. Protected attributes, disparate impact
Privacy Risk of leaking individual data from model. Differential privacy, Federated learning

3. Worked Example – Linear Regression

Problem

Predict a student’s final exam score from hours studied.

Hours Studied (x) Final Score (y)
2 55
4 65
6 70
8 78
10 85

Steps

  1. Define model
    ( \hat{y} = w_0 + w_1 x )

  2. Compute parameters (least‑squares)

    [ w_1 = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sum (x_i - \bar{x})^2} ] [ w_0 = \bar{y} - w_1 \bar{x} ]

    Here, (\bar{x}=6), (\bar{y}=71).

    [ w_1 = \frac{(2-6)(55-71)+(4-6)(65-71)+(6-6)(70-71)+(8-6)(78-71)+(10-6)(85-71)}{(2-6)^2+(4-6)^2+(6-6)^2+(8-6)^2+(10-6)^2} \approx 3.5 ] [ w_0 = 71 - 3.5 * 6 \approx 48 ]

    Model: ( \hat{y} = 48 + 3.5x )

  3. Predict
    For 7 hours studied: ( \hat{y} = 48 + 3.5*7 = 75.5 )

  4. Evaluate

    • Compute Mean Squared Error (MSE) on training data.
    • If MSE is low → good fit; else adjust (regularisation, more data).
  5. Ethical Check

    • Fairness: Does the model treat all student groups equally?
    • Transparency: Is the linear model explainable to stakeholders?
    • Data Bias: Are the training hours representative of all demographics?

Take‑away

Linear regression is the simplest ML algorithm. It showcases the core ML workflow: data → model → training → evaluation → ethical review.


4. Quick Revision Summary

Topic Quick Fact
ML Goal Learn from data to make predictions or decisions.
Supervised vs Unsupervised Labeled data vs. pattern discovery.
Key Metrics Accuracy, Precision, Recall, F1, MSE, AUC‑ROC.
Overfitting High training accuracy, low test accuracy.
Regularisation Adds penalty to keep model simple.
Bias‑Variance Tradeoff Balance between under‑ and over‑fitting.
Ethics Bias, fairness, privacy, transparency.
Common Algorithms Linear/Logistic Regression, Decision Trees, SVM, Neural Networks, K‑Means.
Pipeline Data → Preprocess → Train → Validate → Deploy → Monitor.

Quick Quiz

  1. What does “overfitting” mean in ML?
  2. Name one way to mitigate privacy concerns when training on personal data.
  3. Give an example of a supervised learning task.

Answer:

  1. The model learns noise, performing poorly on new data.
  2. Differential privacy or federated learning.
  3. Email spam classification (input: email, label: spam or not).

Next Steps

  • Experiment with a simple dataset in Python (scikit‑learn).
  • Try a Kaggle “Titanic” notebook to see data cleaning, modelling, and evaluation.
  • Read about AI Ethics frameworks (IEEE, EU AI Act) to understand responsible ML deployment.

Your note

Page 1

Doubt hai is topic me?

Free AI teacher se poocho — 24/7, step by step.