C2_W1_Lab02_CoffeeRoasting_TF, predictions section, test data - what does m refer to

For the coffee roasting lab, in the “Prediction” section, the instructions say that for creating input data, the matrix will be (m,2) where “m is the number of examples.”

This is confusing me as any time you use m, it seems that you’ll be looping somewhere that number of times and the examples in the test array seem to be an array of [temperature, duration roasting] test examples where [200,13.9] for the first array should mean that the 200 value relates to the temperature of the roast, and not the number of examples we had above (200) in the lab, and the 13.9 is the time duration of roasting.

If m really does relate to the number of training examples we had above in the lab (200), and not to the temperature of a test roast, what is the 13.9 number in the first array of the matrix and the 17 in the second array of the matrix?

Isn’t this just a matrix of two test examples and the 200 in each of the two arrays (two test examples) has to relate to the temperature of the respective tests?

I don’t know the specific example but the data is arranged as follows:

matrix

So you have:

  • 2 feature-related columns, and
  • 2 rows, one per example (so this case m = 2)

forming a 2x2 array or matrix.

There won’t be explicit looping (over examples, that is, over rows) because any looping will be abstracted away through the matrix operations that are applied “in a single step” or “in a single formula”.

1 Like

The reference to (m,2) refers to the dimensions of the x_test matrix. It does not refer to the values in each row.
image

There will be ‘m’ rows, and each row will have two columns.

It unfortunately happens that this part of the notebook also uses two test examples. So that’s why x_test is a size (2 x 2) matrix.

1 Like

Thank you for the reply. I think what was confusing my at-the-time-uncaffeinated brain was the same number for temperature repeated for each training example, and that same number being “the number of examples” from above in the lab. It now seems obvious that he was talking about the number of examples in the test set. Thanks again for the help.

1 Like

Thanks for the reply. It seems obvious now that I should have realized he was talking about the number of examples in the test set and not the number of examples in the training set from further up in the lab.

Yes, I see what you mean.

That is a confusing coincidence.

1 Like