6) Advanced optimization(其他优化算法) 如果分类器用的是回归模型,并且已经训练好了一个模型,可以设置一个阈值: 如果\(h_\theta(x) < 0.5\),则预测y=0,既y属于负例; 如果是线性回归模型,对于肿瘤这个二分类问题,图形表示如下: 注: 以下引自李航博士《 统计学习方法 》1.8节关于分类问题的一点描述: 2) Hypothesis Representation 但是线性回归无法做到,这里我们引入一个函数g, 令逻辑回归的Hypothesis表示为: 这里g称为Sigmoid function或者Logistic function, 具体表达式为: Sigmoid 函数在有个很漂亮的“S"形,如下图所示(引自维基百科): 综合上述两式,我们得到逻辑回归模型的数学表达式: 其中\(\theta\)是参数。 例如,对于肿瘤(恶性/良性),如果输入变量(特征)是肿瘤的大小: 这里Hypothesis表示的是”病人的肿瘤有70%的可能是恶性的“。 数学上可以如下表示: 对于因变量y=0或1这样的二分类问题: 当\(h_\theta(x) < 0.5\)时,y = 0; 再次回顾sigmoid function的图形,也就是g(z)的图形: 当\(g(z) \geq 0.5\)时, \(z \geq 0\);
Read full article from Coursera公开课笔记: 斯坦福大学机器学习第六课“逻辑回归(Logistic Regression)” - 我爱公开课
No comments:
Post a Comment