Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started