I completed the exercise successfully but I have a few questions:
1- Please help me understand the features x1 and x2.
Are x1 and x2 features of each blue or red point on the picture and X1 and X2 represent RGB pixel values at specific positions for respective red and blue dots? ( I tried print(X) and it gave 100s of values ).
3- Why is shape of A2 or prediction values after we run predict coming out as (1,3). shouldn’t it be (1,) or scalar value as we just have to decide whether its red(0) or blue(1)? or shape of Y is (1,400) meaning there shall be 1 value for activation?
Please help understand… Thanks in advance
The features x1 and x2 are just the coordinates of a point in the x-y plane. For each “sample” (one point) there is a label y that tells the color of that point: 0 means red and 1 means blue. This was explained in the instructions in the notebook.
The shape of A2 is 1 x m, where m is the number of “samples”. That’s because you have one scalar answer for each sample predicting whether the given point should be red or blue.
Thank you so much for your reply.
So the shape of A2 is (1,m) as I correctly understood earlier but as t_X is used in predict_test_case (exercise 5), its 3 scalar A2 values instead of 400 as t_X has m=3 …hope am correct?
The logic we write is general: it can handle any number of samples and any number of features. They frequently give us test cases with smaller numbers of samples for the “unit tests” in the notebook, just because they are easier to debug with. There is no rule that all the datasets have to have 400 samples. They use 3 samples for some of the test cases for simplicity.
Thanks for your time and clarification