Halloween Sale: Flat 70% + Addl. 25% Off + 30 Days Extra Lab on all Courses | Use Coupon HS25 in Checkout | Offer Expires InEnroll Now
This function predicts the labels of the dataset by calling the sigmoid function.
The prediction for a sample is given out as
Copy-paste the following code to predict.
def predict(w, b, X): m = X.shape Y_prediction = np.zeros((1, m)) w = w.reshape(X.shape, 1) #Compute probability vector A = sigmoid(np.dot(w.T, X) + b) for i in range(A.shape): Y_prediction[0, i] = 1 if A[0, i] > 0.5 else 0 return Y_prediction
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here