简体   繁体   中英

How to draw decision boundary once we get the value of theta?

I am solving the a exercise given by stanford university , machine learning course by Andrew Ng. Question is ( http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=MachineLearning&doc=exercises/ex4/ex4.html ) to plot a decision boundary on the given data and then estimate the result of the new data . I have used the fminunc function to calculate the theta .

I have got three theta value's . But for drawing a line we will need only two theta , then what is the need of the third theta value.

I am unable to plot the decision boundary . please help me out .

It is said you added an intercept term thus it is normal for theta to have three dimension: two gradients (according X and Y plus the bias term). If theta_1 is the bias term, theta_2 the X gradient and theta_3 the Y gradient, the equation of your line is:

Y = -theta_2 / theta_3 .* X + theta_1

Best regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM