how f_wb[i] is working instead of f_wb as it is variable just
m = x.shape[0]
f_wb = np.zeros(m)
for i in range(m):
f_wb[i] = w * x[i] + b
return f_wb
how f_wb[i] is working instead of f_wb as it is variable just
m = x.shape[0]
f_wb = np.zeros(m)
for i in range(m):
f_wb[i] = w * x[i] + b
return f_wb
f_wb is initialized to a vector of zeros, of size ‘m’.
So you can index into f_wb using the ‘i’ variable, since it has the same range ‘m’.
thankyou