[英]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. 我正在解决斯坦福大学提供的一项练习,吴安德(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 .
问题是( http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=MachineLearning&doc=exercises/ex4/ex4.html )在给定数据上绘制决策边界,然后估计新数据的结果。 I have used the fminunc function to calculate the theta .
我已经使用fminunc函数来计算theta。
I have got three theta value's . 我有三个theta值。 But for drawing a line we will need only two theta , then what is the need of the third theta value.
但是为了画一条线,我们只需要两个theta,那么第三个theta值的需求是什么。
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). 据说您添加了一个截距项,因此theta具有三个维度是正常的:两个梯度(根据X和Y加上偏差项)。 If theta_1 is the bias term, theta_2 the X gradient and theta_3 the Y gradient, the equation of your line is:
如果theta_1是偏差项,theta_2是X梯度,theta_3是Y梯度,则线的方程式为:
Y = -theta_2 / theta_3 .* X + theta_1 Y = -theta_2 / theta_3。* X + theta_1
Best regards 最好的祝福
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.