← VCE Data Analytics U3O1

Machine learning for predictions

Training a model on past data so it learns patterns and can predict outcomes for new data, such as a category (classification) or a number (numeric prediction).

Understanding Machine learning for predictions in VCE Data Analytics U3O1

What it does: The output is a label from a set of categories, which is classification rather than numeric prediction. Machine learning trains a model on past data (training data) so it can find patterns. It does not rely on hand-written rules for every case. Pass or fail is a category, so predicting it is classification. Models give predictions, not guarantees. Predictions can be wrong, so their reliability should be checked.

Common mistakes: Training data needs one known outcome for every row. X has 2 rows, so y must have 2 labels, not 3. The model must be trained on past data with fit(X, y). predict() is only used afterwards on new data, so line 4 should be model.fit(X, y).

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 130–148) and word search (Modules 94–148).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does machine learning use to learn patterns?
A fixed set of rules typed in by hand for every casePast data used to train a model
Matches
model.fit(X_new) # train on data with no known outcomes
↓
Training data needs both the inputs and the known outcomes from past data. Without known outcomes the model has nothing to learn from.
Applying
Meanings
Term
machine learning
Meaning
Training a model on past data so it learns patterns and can predict outcomes for new data, such as a category (classification) or a number (numeric prediction).
Practice
=FORECAST(80,D2:D9,B2:B9)
Testing
Gaps
model ← (trainingData)
Check Answer
Spots
1X = [[20, 5], [35, 8]]
2y = ['no', 'yes', 'yes']

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Ostrich' badge — Full Sprint, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does machine learning use to learn patterns?
A. Past data used to train a model ✓
B. A fixed set of rules typed in by hand for every case
Machine learning trains a model on past data (training data) so it can find patterns. It does not rely on hand-written rules for every case.
2. Which describes the model in machine learning?
A. The raw spreadsheet of past data before any learning happens
B. What is produced after training and is used to predict outcomes for new data ✓
The raw past data is the training data. The model is what the system learns from that data, and it is then applied to new data.
3. A model predicts whether a student will pass or fail. What type of prediction is this?
A. Classification ✓
B. Numeric prediction
Pass or fail is a category, so predicting it is classification.
4. A model predicts next month's sales in dollars. What type of prediction is this?
A. Classification
B. Numeric prediction ✓
Sales in dollars is a number, so this is numeric prediction. Classification predicts a category.
5. A model is trained on past house sales. Which is the new data?
A. The details of a house that has not been sold yet ✓
B. The sale prices already recorded in the training data
New data is data the model has not seen before. The model uses patterns from the training data to predict an outcome for it.

Match the Pairs

model.fit(X_train, y_train) → Trains the model on past data so it can learn the patterns linking the inputs to the known outcomes
model.predict(X_new) → Uses the trained model to predict outcomes for new data it has not seen before
Classification predicts a category, such as whether a student will pass or fail → result = model.predict(student) # 'Pass'
Numeric prediction estimates a number, such as next month's sales in dollars → sales = model.predict(month) # 4250.50
model.fit(X_new) # train on data with no known outcomes → Training data needs both the inputs and the known outcomes from past data. Without known outcomes the model has nothing to learn from.
model.predict(X_train) # then claim it works well on new data → Testing a model only on the data it was trained on does not show how well it predicts new data.

Key Term

machine learning
Training a model on past data so it learns patterns and can predict outcomes for new data, such as a category (classification) or a number (numeric prediction).

Fill in the Blanks

1. trainingData ← load("sales.csv") model ← train(trainingData)
Hint: Type the function name that builds a model by learning from the past data.
2. pastResults ← load("results.csv") model ← train(pastResults)
Hint: Type the variable holding the past examples that the model learns from.
3. model ← train(pastStudents) label ← predict(model, newStudent)
Hint: Type the function name that uses the trained model to produce an outcome for new data.
4. label ← predict(model, newStudent) IF label = "Pass" THEN
Hint: Type the comparison operator that checks whether the predicted category matches the text.
5. model ← train(pastMarks) prediction ← predict(model, 6) OUTPUT prediction
Hint: Type the variable that holds the numeric prediction so it can be displayed.

Spot the Error

Question 1
A X = [[20, 5], [35, 8]]
B y = ['no', 'yes', 'yes']
C model = Classifier()
D model.fit(X, y)
Line B — Training data needs one known outcome for every row. X has 2 rows, so y must have 2 labels, not 3.
Question 2
A X = [[1200], [1500], [1800]]
B y = [300, 400, 500]
C model = Regressor()
D model.predict(X, y)
E print(model.predict([[900]]))
Line D — The model must be trained on past data with fit(X, y). predict() is only used afterwards on new data, so line 4 should be model.fit(X, y).
Question 3
A X = [[8, 9], [3, 4], [9, 8]]
B y = ['pass', 'fail', 'pass']
C model = Regressor()
D model.fit(X, y)
Line C — The outcomes are categories (pass or fail), so this is classification. It needs Classifier(), not a numeric Regressor().
Question 4
A train = new_row
B model = learn(train)
C guess = model.predict(new_row)
Line A — A model learns from past data with known outcomes. new_row is the data to predict, so train should be past_results.
Question 5
A price_model = Classifier()
B sizes = [80, 110, 150]
C prices = [310, 450, 520]
D price_model.fit(sizes, prices)
Line A — Prices are numbers, so this is numeric prediction. It needs Regressor(), not a Classifier(), which predicts categories.

Student with a class code? Join your class →