Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago

Question

Define promotion.

Answered: 1 week ago

Question

1. Specify (the values for H).

Answered: 1 week ago