AI · 3.1
Everything Is Numbers: Turning the World into Data
Name
Class
Date
Mark / 21
Section A
Circle the letter of the correct answer. One mark each.
- 1In a dataset table, what does each row usually represent?1
- AOne model trained on the data
- BOne example, such as one house or one image
- COne label, such as the price
- DOne feature, such as floor area
- 2How many numbers does a 224 × 224 colour image contain?1
- A224
- B672
- C50,176
- D150,528
- 3Why is one-hot encoding used for a feature such as 'favourite sport'?1
- AIt removes outliers from the feature automatically
- BNumbering sports would imply a false order and sizes
- CIt makes the dataset smaller and faster to train on
- DModels are not able to store any text in memory
- 4Which of these is a matrix?1
- AA greyscale image of 28 × 28 pixels
- BA single temperature reading
- CA batch of 32 colour images
- DOne house described by three features
- 5What is [2, 0, 1] · [3, 5, 4]?1
- A9
- B10
- C15
- D24
- 6A dot product of two vectors is large and positive. What does that suggest?1
- AThey point in a similar direction
- BThey point in opposite directions
- CThey are unrelated
- DOne of them is zero
- 7What does min-max normalisation do?1
- ASorts the values from smallest to largest
- BRemoves the largest and smallest values
- CRescales a feature so its values lie between 0 and 1
- DMakes the mean of a feature equal to its maximum
- 8Why should scaling statistics be calculated from the training data only?1
- AUsing the test data would leak information from it into training
- BIt makes training faster
- CThe training data has no outliers
- DThe test data is always too small to use
- 9Which feature is ordinal?1
- ACountry of birth: UK, India or Brazil
- BHeight in centimetres: 152, 167 or 181
- CEye colour: blue, brown or green
- DT-shirt size: small, medium or large
- 10CD quality audio has 44,100 samples per second. Roughly how many numbers is a 3 minute mono recording?1
- AAbout 132,000
- BAbout 2.6 million
- CAbout 7.9 million
- DAbout 44,100
Section B
Answer in the space provided. The number of marks tells you how many separate points to make.
- 1ExplainExplain how a colour photograph is represented so that a machine learning model can use it.4
- 2ExplainA model predicts house prices using floor area in square metres and number of bedrooms. Explain why the features should be scaled, and describe one way to scale them.4
- 3CalculateCalculate the dot product of [3, −1, 2] and [1, 4, 2], showing your working, and state what the sign of the answer tells you.3
Mark scheme
Section A
Section B
1 Explain how a colour photograph is represented so that a machine learning model can use it. 4
One mark for each of the following, to a maximum of 4.
- The image is a grid of pixels
- Each pixel has red, green and blue values / three channels
- Each value is a number, usually 0 to 255
- Stored as a tensor of height × width × 3, often scaled to 0 to 1
Model answer. The photograph is divided into a grid of pixels. Each pixel is stored as three numbers, one for each of the red, green and blue channels, usually from 0 to 255. Together the values form a tensor with the shape height × width × 3, which is normally scaled to the range 0 to 1 before being given to the model.
2 A model predicts house prices using floor area in square metres and number of bedrooms. Explain why the features should be scaled, and describe one way to scale them. 4
One mark for each of the following, to a maximum of 4.
- The features are on very different scales / ranges
- The larger feature dominates distances or slows training
- Min-max: (x − min) ÷ (max − min), or standardise: (x − mean) ÷ standard deviation
- Using statistics from the training data only
Model answer. Floor area runs to hundreds while bedrooms run from 1 to about 6, so without scaling the floor area would dominate any distance calculation and gradient descent would train slowly and unevenly. Min-max normalisation fixes this by replacing each value with (x − min) ÷ (max − min), putting both features between 0 and 1. The min and max must be taken from the training data only and then applied unchanged to test data and new inputs.
3 Calculate the dot product of [3, −1, 2] and [1, 4, 2], showing your working, and state what the sign of the answer tells you. 3
One mark for each of the following, to a maximum of 3.
- 3×1 + (−1)×4 + 2×2
- = 3
- Positive, so the vectors point in a broadly similar direction
Model answer. 3 × 1 + (−1) × 4 + 2 × 2 = 3 − 4 + 4 = 3. The answer is positive, so the two vectors point in a broadly similar direction, though not strongly.