Day7 Regression Case study (预测宝可梦的cp)
Regression 可以做什么? 股票预测 自动驾驶 推荐 预测宝可梦的cp(能力类似这样的属性把)
这里突然想到,是不是可以用洛克王国和赛尔号做事情哈哈
注意: 用下标来表示某一个完整的物体的某一个部分,例如:x 表示妙蛙种子;那么 xhp 就表示它的生命值,xcp 就表示我们要预测的战斗力等等
review 做机器学习的三个步骤:
- 找一个model(function set 关于函数的集合)
- 制定评价函数好坏的指标
- 找一个最好的function
Example:预测宝可梦
Step1 Model

注意这里的做法看似简单, 但是这种思想却是贯穿机器学习始末的:用简单的抽象的函数来表示我需要解决的问题


Step2 Goodness of function
抓取一部分的training Data 来训练我的参数
注意:这里用上标来表示一个完整的个体的编号; 在本课程中使用 y(head) y ∧ y\wedge y∧来表示正确的值
Loss Function : 一个函数的函数
input: a function ,output :how bad it is

因为f 是由w 和b 来决定的
Step 3 Best Function (Gradient Descent )
找到最好的function, 也就是使得 L 最小
这里用线性代数的方法可以直接求 ,最速下降法(Gradient Descent)更有普遍性和计算机领域的意义
how can we do better ?
select another model




个人感觉这里用多项式进行复杂函数的逼近,有一点像泰勒展开(泰勒级数)不同的点在于,这里的w 是彼此无关的,然而泰勒级数的展开式和展开点相关性极强


从这里可以嗅到过拟合(Overfitting)的味道啦~
Let’s collect more data

what are the hidden factors ?

improve the model (consider the category )
Redesign the Model

这样的变形还是 linear model 吗?分段?


这里蓝色的部分就是我的feature ,本质上还是 linear model
Are there any other hidden factors?

使用了一个比较复杂的function ,发现过拟合了
两种方案:去掉不重要的因素feature
or Regularzation (正则化)

更加平滑; 减少 输入xi 对输出的影响; 红色的框框就是 Regularization的项
why we like the smooth ? (哎嘿~ 哈哈 🚗 )
减少noises 的干扰(尤其是我们并不知道 noises 是什么的情况下, 如果知道的话 直接剪掉不就好了哈哈)

λ \lambda λ 太小,过拟合, 太大 欠拟合
how smooth ? (如何选择 合适的 λ \lambda λ) 这里老师简单跳过了,直接看图选
为什么不加b?
b 的大小和平滑程度无关,
Conclusion
- cp is determined b the before cp and the species
- Gradient Descent(我这里没有过多花时间,因为之前学过几遍了, 感兴趣的同学可以去看看吴恩达的Gradient Descent)
- Over fitting and Regularization (正则化) (这里加深了对正则化的理解,注意区分 正则化和 归一化这类预处理)
-
提问:好吧 不知道,感觉有高有低没有依据