【发布时间】:2014-11-14 19:51:45
【问题描述】:
我尝试过使用具有多项式特征的逻辑回归,幸运的是它对我来说工作正常,而且我能够绘制决策曲线。我已将 map_feature 函数用于多项式特征。 (我参考了 Andrew 教授关于正则化逻辑回归的笔记):http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=MachineLearning&doc=exercises/ex5/ex5.html
现在我正在尝试使用高斯内核而不是采用多项式特征来实现相同的目标。幸运的是,我的成本函数 (j_theta) 工作正常,并且在每次迭代后都会减小,我得到了最终的 theta 值。 我现在面临的问题是如何在这里绘制决策边界
I am using Octave to develop the algorithms and plot the graphs..
以下是我的数据集大小的详细信息
原始数据集:
Data Set (x): [20*3] where the first column is the intercept or the bias column
1.00 2.0000 1.0000
1.00 3.0000 1.0000
1.00 4.0000 1.0000
1.00 5.0000 2.0000
1.00 5.0000 3.0000
.
.
.
实施高斯核后具有新特征的数据集
Data set (f) : [20*21] the first column is the intercept column with all values as 1
1.0000e+000 1.0000e+000 6.0653e-001 1.3534e-001 6.7379e-003 . . . . . . . .
1.0000e+000 6.0653e-001 1.0000e+000 6.0653e-001 8.2085e-002 . . . . . . . .
1.0000e+000 1.3534e-001 6.0653e-001 1.0000e+000 3.6788e-001
1.0000e+000 6.7379e-003 8.2085e-002 3.6788e-001 1.0000e+000
. .
. .
. .
. .
. .
在我的新特征数据集 (f) 上应用梯度下降后得到的成本函数图是:
因此我得到了新的 theta 值:
theta: [21*1]
3.8874e+000
1.1747e-001
3.5931e-002
-8.5937e-005
-1.2666e-001
-1.0584e-001
.
.
.
我现在面临的问题是如何在具有新特征数据集和 theta 值的原始数据集上构建决策曲线。我不知道我该如何进行。
如果我能得到一些可以帮助我解决问题的线索、教程或链接,我会很高兴。
感谢您的帮助。谢谢
【问题讨论】:
标签: matlab machine-learning octave