Question: solve with python Expected output: predictions= [[1. 1. 0. 0.]] predictions= [[1. 0. 1. 1.]] Task 5. Implement the function to predict 2 points Given

solve with python

solve with python Expected output: predictions= [[1. 1. 0. 0.]] predictions= [[1.

0. 1. 1.]] Task 5. Implement the function to predict 2 points

Expected output:

predictions= [[1. 1. 0. 0.]] predictions= [[1. 0. 1. 1.]]

Task 5. Implement the function to predict 2 points Given new data X, parameters w and b, the function makes predictions on whether each example in X is 0 or 1. . Hint: - First, compute the activation using A=(wTX+b). The resulting A is a 1m matrix, [a(1),a(2),,a(m)], in which a(i) is the probability that x(i)=1 - Second, you need to convert probabilities to real predictions by assigning Ypred(i) to 1 if a(1)>0.5, else to 0 . \#\#\#\# DO NOT CHANGE THE CODE BELOW \#\#\#\# \# Evaluate Task 5 print ( 'predictions ={}. format (predict(X,w,b))) print ('predictions ={} '.format (predict(X, params['w'], params['b'])))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!