Module 3: Software Automation

NSWSoftware EngineeringSyllabus dot point

Inquiry Question 1: How do machine learning systems work?

Compare supervised, unsupervised and reinforcement learning, and identify a typical application of each

A focused answer to the HSC Software Engineering Module 3 dot point on learning paradigms. Supervised classification and regression, unsupervised clustering, reinforcement learning, applications of each, the worked example, and the traps markers look for.

Generated by Claude OpusReviewed by Better Tuition Academy5 min answer

Have a quick question? Jump to the Q&A page

What this dot point is asking

NESA wants you to compare the three main paradigms of machine learning, identify what kind of training data each needs, and give a typical application of each.

The answer

Supervised learning

The training data has both features and labels. The algorithm learns the function from features to label. Two sub-categories:

  • Classification: the label is a category. Spam vs not spam. Cat vs dog. The output is a class.
  • Regression: the label is a number. Predicting house prices, exam marks, stock prices. The output is a continuous value.

Common algorithms: logistic regression, decision trees, random forests, gradient-boosted trees, support vector machines, neural networks.

Applications:

  • Email spam filtering (classification).
  • Image classification (classification).
  • House price prediction (regression).
  • Disease diagnosis from medical imaging (classification).
  • Forecasting daily power demand (regression).

Unsupervised learning

The training data has features but no labels. The algorithm finds structure in the data on its own. Sub-categories:

  • Clustering: group similar examples together. K-means is the textbook algorithm.
  • Dimensionality reduction: compress many features into a few. Principal Component Analysis (PCA), t-SNE.
  • Anomaly detection: flag examples that are very different from the rest.

Applications:

  • Customer segmentation in marketing.
  • Recommendation engines (people similar to you also liked...).
  • Fraud detection (transactions that look unusual).
  • Topic modelling on a corpus of documents.

Reinforcement learning

An agent learns by interacting with an environment, receiving rewards or penalties for its actions. The algorithm learns a policy that maximises long-term reward.

Vocabulary:

  • Agent: the learner.
  • Environment: the world the agent acts in.
  • State: a snapshot of the environment.
  • Action: a choice the agent makes.
  • Reward: feedback after each action.
  • Policy: the strategy the agent learns.

Applications:

  • Game playing (AlphaGo, Chess engines, video games).
  • Robotics (a robot learning to walk).
  • Autonomous driving decisions.
  • Resource scheduling and operations research.

A worked Python example: supervised classification

from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report

data = load_breast_cancer()
X = data.data  # 30 features per tumour
y = data.target  # 0 = malignant, 1 = benign

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42
)

model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
predictions = model.predict(X_test)
print(classification_report(y_test, predictions))

A worked example: unsupervised clustering

from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans

X, _ = make_blobs(n_samples=300, centers=4, random_state=42)

# No labels passed to fit.
model = KMeans(n_clusters=4, random_state=42, n_init=10)
clusters = model.fit_predict(X)

# `clusters` assigns each example to one of 4 groups, learned from structure alone.

The same data is being analysed, but kmeans.fit_predict(X) takes only features, while RandomForestClassifier.fit(X, y) takes features and labels.

How to choose

Situation Paradigm
You have labelled examples and want to predict the label for new data Supervised
You have unlabelled examples and want to discover groups or anomalies Unsupervised
You have an agent that can act in an environment and receive rewards Reinforcement

Most real systems combine paradigms. A recommendation engine might use unsupervised clustering to discover taste groups, supervised regression to predict ratings, and reinforcement learning to optimise long-term engagement.

Past exam questions, worked

Real questions from past NESA papers on this dot point, with our answer explainer.

2025 HSC5 marksCompare supervised and unsupervised learning. For each, describe an example application and identify what the training data looks like.
Show worked answer →

Supervised learning trains on labelled examples - each row of training data has both features and the known correct answer (label). The model learns the function from features to label.

  • Training data: features plus labels. Example: medical scans labelled by a radiologist as "tumour" or "no tumour".
  • Application: classifying chest x-rays as showing pneumonia. The hospital collects thousands of scans, each labelled by a doctor, and trains a model to classify new scans.
  • Output: a prediction (the label) for new examples.

Unsupervised learning trains on unlabelled examples - only features, no answers. The algorithm finds structure on its own.

  • Training data: features only. Example: customer purchase histories with no segments attached.
  • Application: customer segmentation in retail. The algorithm clusters customers into groups with similar buying habits without anyone defining the groups in advance.
  • Output: a structure (clusters, dimensions, anomalies) derived from the data.

The key difference is the availability of labels. Supervised problems have an answer; unsupervised problems require the algorithm to find patterns in the data alone. Labelling is expensive, so unsupervised methods are common when labels are unavailable.

Markers reward both definitions, the labels vs no labels distinction, a concrete application for each, and recognising that both are still learning patterns from data.

Related dot points