Course1_SuperviedMachineLearning

Supervised machine learning : Linear Regression and Logistic Regression

吴恩达机器学习系列课程的第一部分,下面是学习过程中整理的一些我认为的重点部分!希望这些知识可以帮助到更多的人!

2024.8.13 by 王棱夹

回归算法的核心(一张图就可以说明)!

image-20240802081306253

监督学习的分类

image-20240415233212886

梯度下降

image-20240425000439045

simultinuously update

derivative 派生物,衍生物——导数

线性回归的梯度下降公式推导

image-20240425233451551

iteration 迭代

特征缩放(freature scaling):

image-20240429123522933

原因:

数量级的差异将导致量级较大的属性占据主导地位
数量级的差异将导致迭代收敛速度减慢
依赖于样本距离的算法对于数据的数量级非常敏感

好处:

提升模型的精度:在机器学习算法的目标函数中使用的许多元素(例如支持向量机的 RBF 内核或线性模型的 l1 和 l2 正则化),都是假设所有的特征都是零均值并且具有同一阶级上的方差。如果某个特征的方差比其他特征大几个数量级,那么它就会在学习算法中占据主导位置,导致学习器并不能像我们期望的那样,从其他特征中学习
**提升收敛速度:**对于线性模型来说,数据归一化后,寻找最优解的过程明显会变得平缓,更容易正确地收敛到最优解

线性回归为什么无法处理分类问题

image-20240501232318574

image-20240811175756500

sigmoid function == logistic function

image-20240811181332588

作用:把 Z Z Z 映射到0,1之间

image-20240811182207529

应用 L o g i s t i c    R e g r e s s i o n Logistic \; Regression LogisticRegression 解决分类问题

image-20240501234652482


Decision boundary

image-20240811185023463

image-20240811185241199

image-20240811185542485

上图蓝线即为 D e c s i o n    B o u n d a y Decsion\;Bounday DecsionBounday

image-20240501234928127

l o g s i t i c    l o s s    f u n c t i o n logsitic\; loss\; function logsiticlossfunction

  • 需要理解:为什么线性回归中 s q u a r e d    e r r o r    l o s s squared\;error\;loss squarederrorloss 无法解决 l o g s t i c    r e g r e s s i o n logstic\;regression logsticregression

image-20240812010022976

image-20240812010053362

可以看出 l o g i s t i c    r e g r e s s i o n logistic\;regression logisticregression 的非线性特征,决定它必须使用不同的 e r r o r    l o s s error\;loss errorloss

image-20240502095722744

Loss和Cost的区别

Loss is a measure of the difference of a single example to its target value while the
Cost is a measure of the losses over the training set

maximum likelihood :最大似然估计

L o g e s t i c    R e g r e s s i o n Logestic\;Regression LogesticRegression的梯度下降

  • 注意和 L i n e a r    R e g r e s s i o n Linear\;Regression LinearRegression的区别

image-20240502103234223

image-20240502103443378

regularization正则化

  • u n d e r f i t underfit underfit o v e r f i t overfit overfit
  • h i g h    v a r i a n c e high\;variance highvariance h i g h t    b i a s hight\;bias hightbias

image-20240502104825979

如何处理过拟合

  1. collect more data
  2. select features
  3. reduce the size of parameters using regularization

penalize惩罚

  • 18
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值