Back to the topic

AI · 3.1

Everything Is Numbers: Turning the World into Data

Section A: 10 multiple choice questions, 10 marks. Section B: 3 written questions, 11 marks. Total 21 marks.

Name

Class

Date

Mark  / 21

Section A

Circle the letter of the correct answer. One mark each.

  1. 1In a dataset table, what does each row usually represent?1
    1. AOne model trained on the data
    2. BOne example, such as one house or one image
    3. COne label, such as the price
    4. DOne feature, such as floor area
  2. 2How many numbers does a 224 × 224 colour image contain?1
    1. A224
    2. B672
    3. C50,176
    4. D150,528
  3. 3Why is one-hot encoding used for a feature such as 'favourite sport'?1
    1. AIt removes outliers from the feature automatically
    2. BNumbering sports would imply a false order and sizes
    3. CIt makes the dataset smaller and faster to train on
    4. DModels are not able to store any text in memory
  4. 4Which of these is a matrix?1
    1. AA greyscale image of 28 × 28 pixels
    2. BA single temperature reading
    3. CA batch of 32 colour images
    4. DOne house described by three features
  5. 5What is [2, 0, 1] · [3, 5, 4]?1
    1. A9
    2. B10
    3. C15
    4. D24
  6. 6A dot product of two vectors is large and positive. What does that suggest?1
    1. AThey point in a similar direction
    2. BThey point in opposite directions
    3. CThey are unrelated
    4. DOne of them is zero
  7. 7What does min-max normalisation do?1
    1. ASorts the values from smallest to largest
    2. BRemoves the largest and smallest values
    3. CRescales a feature so its values lie between 0 and 1
    4. DMakes the mean of a feature equal to its maximum
  8. 8Why should scaling statistics be calculated from the training data only?1
    1. AUsing the test data would leak information from it into training
    2. BIt makes training faster
    3. CThe training data has no outliers
    4. DThe test data is always too small to use
  9. 9Which feature is ordinal?1
    1. ACountry of birth: UK, India or Brazil
    2. BHeight in centimetres: 152, 167 or 181
    3. CEye colour: blue, brown or green
    4. DT-shirt size: small, medium or large
  10. 10CD quality audio has 44,100 samples per second. Roughly how many numbers is a 3 minute mono recording?1
    1. AAbout 132,000
    2. BAbout 2.6 million
    3. CAbout 7.9 million
    4. DAbout 44,100

Section B

Answer in the space provided. The number of marks tells you how many separate points to make.

  1. 1ExplainExplain how a colour photograph is represented so that a machine learning model can use it.4
  2. 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
  3. 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

1B2D3B4A5B6A7C8A9D10C

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.