【问题标题】:How to draw decision boundary once we get the value of theta?一旦我们得到 theta 的值,如何绘制决策边界?
【发布时间】:2015-06-01 05:41:08
【问题描述】:

我正在解决斯坦福大学的一个练习,Andrew Ng 的机器学习课程。 问题是 (http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=MachineLearning&doc=exercises/ex4/ex4.html) 在给定数据上绘制决策边界,然后估计新数据的结果。 我已经使用 fminunc 函数来计算 theta 。

我有三个 theta 值。但是为了画一条线,我们只需要两个 theta ,那么第三个 theta 值的需要是什么。

我无法绘制决策边界。请帮帮我。

【问题讨论】:

    标签: artificial-intelligence octave svm logistic-regression


    【解决方案1】:

    据说您添加了一个截距项,因此 theta 具有三个维度是正常的:两个梯度(根据 X 和 Y 加上偏置项)。如果 theta_1 是偏置项,theta_2 是 X 梯度,theta_3 是 Y 梯度,那么你的直线方程是:

    Y = -theta_2 / theta_3 .* X + theta_1

    最好的问候

    【讨论】:

    • 你的 y 截距实际上应该是 theta_1/theta_3。
    猜你喜欢
    • 2017-07-30
    • 2014-02-26
    • 2021-05-17
    • 2013-10-03
    • 2021-07-30
    • 2022-06-16
    • 2016-06-13
    • 2014-08-07
    相关资源
    最近更新 更多