网站建设业务好做吗,搜索引擎营销概念,自己可以制作微信小程序吗,泸县城乡住房建设厅网站机器学习笔记——回归(Regression) 一、何为回归二、案例背景三、研究过程1.选择模型2.衡量函数的好坏3.选择最优的函数4.梯度下降(Gradient Descent)4.1单变量梯度下降4.2双变量梯度下降4.3偏微分的求解方法5.拟合分析6.其他因素6.1物种考虑6.2其他因素6.3过拟合的处理——…
机器学习笔记——回归(Regression) 一、何为回归 二、案例背景 三、研究过程 1.选择模型 2.衡量函数的好坏 3.选择最优的函数 4.梯度下降(Gradient Descent) 4.1单变量梯度下降 4.2双变量梯度下降 4.3偏微分的求解方法 5.拟合分析 6.其他因素 6.1物种考虑 6.2其他因素 6.3过拟合的处理——正则化(Regularization)
一、何为回归
回归是一种预测性的建模技术 ,研究的是自变量与因变量之间的关系,通常使用曲线来拟合数据点,想要使得拟合曲线到各个数据点之间的误差总和最小。当达到一定预测精度后,就可以用该拟合曲线来代表该自变量与因变量之间的关系,并且可以用他来处理更多的输入。 回归可以分为线性回归(Linear Regression)和 逻辑回归(Logistic Regression) 。线性回归仅仅解决了回归的问题,而逻辑回归则可以解决分类的问题,比如二分类问题。
二、案例背景
我们将使用李宏毅老师的案例做进一步的细化解释。玩过宝可梦的同学都知道,每只宝可梦进化后战斗力都会获得不同程度的提升,而进化则都需要付出一定的代价,所以我们要选择最有价值的宝可梦进化。 因此我们用回归的方式研究宝可梦进化前后战斗力(Combat Power CP)的变化。输出y即为进化后的战斗力数值,而输入x我们先从单一变量进化前的CP值 x c p x_{cp} x c p 开始研究,后续逐渐考虑多因素,比如宝可梦的血量HP x h p x_{hp} x h p ,体重Weight,高度Height。
三、研究过程
1.选择模型
模型选择我们从最基本的开始,考虑线性回归 也就是构建多元一次的函数模型 。 线性回归(Linear Regression)模型如下: y = b + Σ w i x i y=b + \Sigma w_ix_{i} y = b + Σ w i x i 针对此案例,我们的 x i x_i x i 可以取 x c p , x h p , x w , x h x_{cp},x_{hp},x_w,x_h x c p , x h p , x w , x h 。但为了初步好理解,我们只考虑单元素输入,即初步模型定为: y = b + w x c p y=b + wx_{cp} y = b + w x c p 该模型代表了一组函数的集合,并且集合内函数的个数是无限的,因为一开始没有任何限定条件,b与w均可以取任意值。但我们也可以结合问题的实际情况做出初步的筛选,比如说参数值使y恒为负的我们可以不考虑。
2.衡量函数的好坏
模型初步划定范围后,我们还是有无限的选择可能。那么我们就需要制定一个衡量函数优劣的标准,来指导我们进一步选定参数,确定函数。 因此我们引入了**损失函数(Loss Function)**的概念。损失函数输入的是函数,输出的是该函数针对此问题到底有多糟糕。 可以说损失函数L是关于模型函数f的函数,并且f又是关于两个参数w,b的函数,因此也可以说损失函数是用来衡量两个参数w与b的函数。 我们用最简单的误差衡量方式:平方和来构建损失函数 。 L ( f ) = ∑ n = 1 10 ( y n − f ( x c p n ) ) 2 L(f)=\sum_{n=1}^{10} {(y^n-f(x^n_{cp}))^2} L ( f ) = ∑ n = 1 1 0 ( y n − f ( x c p n ) ) 2 其中 y n y^n y n 表示第n个数据的实际y值, f ( x c p n ) f(x^n_{cp}) f ( x c p n
文章转载自: http://romanticise.pwrb.cn http://overblouse.pwrb.cn http://enterogastrone.pwrb.cn http://convivialist.pwrb.cn http://craniota.pwrb.cn http://chrismation.pwrb.cn http://riflescope.pwrb.cn http://nc.pwrb.cn http://caesarist.pwrb.cn http://cholesterolemia.pwrb.cn http://hershey.pwrb.cn http://whitehall.pwrb.cn http://vmi.pwrb.cn http://banalize.pwrb.cn http://lumberjack.pwrb.cn http://unpretending.pwrb.cn http://dystrophication.pwrb.cn http://omniscience.pwrb.cn http://peculiar.pwrb.cn http://keitloa.pwrb.cn http://chace.pwrb.cn http://nucleoplasm.pwrb.cn http://dormouse.pwrb.cn http://angwantibo.pwrb.cn http://crabgrass.pwrb.cn http://butt.pwrb.cn http://rehear.pwrb.cn http://diffractive.pwrb.cn http://parabola.pwrb.cn http://thibetan.pwrb.cn http://amicably.pwrb.cn http://plausibility.pwrb.cn http://subdebutante.pwrb.cn http://miniascape.pwrb.cn http://electrochronograph.pwrb.cn http://quaternion.pwrb.cn http://wanking.pwrb.cn http://metabolise.pwrb.cn http://flagellum.pwrb.cn http://tharm.pwrb.cn http://interiorly.pwrb.cn http://esquamate.pwrb.cn http://submit.pwrb.cn http://gamboge.pwrb.cn http://pergunnah.pwrb.cn http://pcl.pwrb.cn http://cruor.pwrb.cn http://reassurance.pwrb.cn http://oomiac.pwrb.cn http://myelin.pwrb.cn http://omdurman.pwrb.cn http://parabasis.pwrb.cn http://outmoded.pwrb.cn http://circumaviate.pwrb.cn http://pterin.pwrb.cn http://komodo.pwrb.cn http://neurofibroma.pwrb.cn http://fmi.pwrb.cn http://haploidy.pwrb.cn http://graeae.pwrb.cn http://ptfe.pwrb.cn http://crick.pwrb.cn http://penumbral.pwrb.cn http://smudginess.pwrb.cn http://phytoecology.pwrb.cn http://kweilin.pwrb.cn http://virtuousness.pwrb.cn http://collectanea.pwrb.cn http://lobbyman.pwrb.cn http://mexico.pwrb.cn http://peaceable.pwrb.cn http://eutrophication.pwrb.cn http://ewigkeit.pwrb.cn http://moult.pwrb.cn http://fumitory.pwrb.cn http://atrioventricular.pwrb.cn http://absquatulater.pwrb.cn http://knight.pwrb.cn http://weeds.pwrb.cn http://disband.pwrb.cn http://effulgent.pwrb.cn http://plica.pwrb.cn http://papaveraceous.pwrb.cn http://cankerroot.pwrb.cn http://unattached.pwrb.cn http://galingale.pwrb.cn http://unmindful.pwrb.cn http://hatemonger.pwrb.cn http://dinero.pwrb.cn http://communization.pwrb.cn http://waterlog.pwrb.cn http://undine.pwrb.cn http://amniote.pwrb.cn http://upriver.pwrb.cn http://crackly.pwrb.cn http://eugenol.pwrb.cn http://cheka.pwrb.cn http://keet.pwrb.cn http://flurazepam.pwrb.cn http://tenotomy.pwrb.cn