当前位置:网站首页>Machine learning by Li Hongyi 2. Regression
Machine learning by Li Hongyi 2. Regression
2022-07-26 11:33:00 【Hua Weiyun】
One 、 Return to (Regression)
Return to (Regression): Find a function Function, By entering a feature , Output a value .
Application, for example,
Stock market forecast (Stock market forecast)
Autopilot (Self-driving Car)
recommendation (Recommendation)
Pokemon Elf attack power prediction (Combat Power of a pokemon):
Two 、 Model steps
2.1 The model assumes - Linear model
- Univariate linear model ( A single feature )
Model to represent :
- Multivariate linear model ( Multiple features )
Model to represent :
- : All kinds of characteristics (fetrure)
- : The weight of each feature
- b: Offset
2.2 Model to evaluate - Loss function
A single feature :.
Definition It's pre evolutionary CP value , For the evolved CP value , What it represents is the real value .
collect 10 Group true value , With these real data , How do we measure the quality of the model ? Mathematically speaking , We use distance . seek 【 After evolution CP value 】 And 【 The model predicted CP value 】 Bad , To determine the quality of the model . That is, using the loss function (Loss function) To measure the quality of the model .

▲ Loss function (Loss Function)
take and Show... In two-dimensional coordinates
- Each point in the figure represents the corresponding point of a model and ;
- The darker the color, the better the model .

▲ w and b Show... In two-dimensional coordinates
2.3 Model optimization - gradient descent
A single feature :.
How to select the optimal model ( Find out what makes Loss Function The smallest and )

▲ Definition f*
- From the simplest, there is only one parameter Starting with , Definition
step 1: Choose one at random
step 2: Calculate the differential , That is, the current slope , Determine the direction of movement according to the slope
- Greater than 0 To the right ( increase ww)
- Less than 0 Move to the left ( Reduce ww)
step 3: Move according to the learning rate
Repeat step 2 And steps 3, Until you find the lowest point

▲ Gradient descent process
- For two parameters and , The procedure is similar to one of the above parameters , What we need to do is partial differential .

▲ Two parameter partial differential process
The challenge of gradient descent algorithm in the real world
- problem 1: The best at the moment (Stuck at local minima)
- problem 2: be equal to 0(Stuck at saddle point)
- problem 3: Tend to be 0(Very slow at the plateau)

▲ The problem of gradient descent
In the linear model, it is the shape of a bowl ( Valley shape ), Gradient descent can basically find the best , But in other more complex models , Will meet problem 2 and problem 3 .
Verify whether the model is good or bad
Use Average error of training set and test set To verify the quality of the model .
3、 ... and 、 Over fitting (Overfitting)
Based on a simple model , It can be optimized , Choose a more complex model ( One yuan N Sublinear model ), Or use polynomial Fitting .
If we choose a higher power model , Better models in the training set , On the test set, the effect may be worse . This is the problem of over fitting the model on the training set .

▲ Over fitting (Overfitting) The problem of
Four 、 Regularization (Regularization)
For more features , But the weight The weight of some features may be too high , Still lead to overfitting, You can add regularization .

▲ Regularization (Regularization)

▲ Adjust the λ Get the best model
5、 ... and 、 summary
Datawhale Team learning , Li Hongyi 《 machine learning 》Task2. Regression( Return to ), It mainly includes the definition of regression 、 To create a model 、 How to optimize the model 、 Possible problems in the process of optimizing the model and using regularization to solve the problem of over fitting .
边栏推荐
猜你喜欢
随机推荐
Common library installation
X 2 Earn必须依靠旁氏启动?Gamefi的出路在哪?(上)
Pyqt5 rapid development and practice 3.1 QT designer quick start
数据可视化-《白蛇2:青蛇劫起》(2)
梅科尔工作室-华为14天鸿蒙设备开发实战笔记八
AuthorizingRealm简介说明
【转载】多元高斯分布(The Multivariate normal distribution)
702 horsepower breaks through 100 in only 4.5 seconds! The strongest pickup truck comes, safe and comfortable
由浅入深搭建神经网络
Orbslam2 cmakelists File Structure Parsing
ESP8266-Arduino编程实例-开发环境搭建(基于Arduino IDE)
SQL statement of SQL server creates database
并发三大性质
正点原子stm32中hal库iic模拟`#define SDA_IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` //PB9 输入模式
ORBSLAM2 CmakeLists文件结构解析
Data visualization - White Snake 2: black snake robbery (2)
Static routing and dynamic routing
3dunity game project practice - first person shooting game
『MongoDB』MongoDB高可用部署架构——复制集篇(Replica Set)
[learning progress] may







![[idea]如何新建一个项目](/img/33/f210d59ccd3664487f401929dac24c.png)

