I think in general
theta1 = X.shape[1] … this should be the convention. Luckily here the Number of feature in X is equal to 1 so this code will work… otherwise we have make sure of it .
Hope so i am on the right track ?
I think in general
theta1 = X.shape[1] … this should be the convention. Luckily here the Number of feature in X is equal to 1 so this code will work… otherwise we have make sure of it .
Hope so i am on the right track ?
yes you are right, that is when we say our hypothesis = w * X^T + b, here w has shape of (1,number of features in x) and x has shape of (no of examples, number of features) and b is scalar. This part is covered in the following videos as well.
Hope this cleared your doubt.