In [11]:
# predict with logistic regression

y_predictions = [] # y_prediction will be a list of all predicted values
z=[]
a=[]

for i in range(len(X_test)):
    
    z_temp  = w1_final*X_test[i,0] + w2_final*X_test[i,1] + b_final
    a_temp =  sigmoid(z_temp) # a_temp = y_hat 
    
    a.append(a_temp)
    z.append(z_temp)
    
    if a_temp > 0.5:
        y_predictions.append(1)
    else:
        y_predictions.append(0)       
        
y_pred = np.array(y_predictions) # we will put predictions in NumPy array because it is easier to manupulate