简体   繁体   English

一旦获得theta的值,如何绘制决策边界?

[英]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.

相关问题 在更新参数theta之后,如何引导决策边界 - How is the decision boundary piloted after the parameters theta are updated 马尔可夫决策过程:价值迭代,它是如何运作的? - Markov Decision Process: value iteration, how does it work? 值迭代不收敛-马尔可夫决策过程 - Value iteration not converging - Markov decision process 理解马尔可夫决策过程的值迭代算法 - Understanding The Value Iteration Algorithm of Markov Decision Processes 在值迭代中重复效用值(马尔可夫决策过程) - Repeating utility values in Value Iteration (Markov Decision Process) 如果使用minMaxLoc函数如何替换像素值 - How to replace pixel value if we use minMaxLoc function 部分可观察的马尔可夫决策过程最优值函数 - Partially Observable Markov Decision Process Optimal Value function 为什么我们在决策树学习中选择熵增益作为标准,而不是将错误率降低作为标准? - Why do we select Entropy Gain as criteria in Decision Tree learning instead of decrease in error rates as a criteria? 如何使用 ID3 决策树为一个数据集做出决策 - How can I make decision for exactly one data set using ID3 decision tree 如何组织用于多级建模的数据-决策树,分类或回归 - How to organize data for Mutllevel modeling - Decision Tree, Classification, or Regression
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM