Machine Learning - Simple linear regression(Principle)

Simple linear regression:


        Known data sets   D = {(x_1,y_2),(x_2,y_2)....(x_n,y_n)}   There is only one self-variable x with a variable y. And x and y satisfy a linear relationship.

        For these questions,we are trying to fit the following equation:

        f(x_i) = wx_i + b

        Simultaneously make f(x_i) \doteq y_i in the above equation,It can be seen from this that determining w and b is the most important issue among them.

        In the regression task, we use mean squared error as a measure of performance, so we need to determine how much the mean squared error can be minimized when w and b are equal to:

(w^{*},b^{*}) = argmin_{(w,b)}\sum_{i = 1}^{m}(f(x_i) - y_i)^{2}

                     =argmin_{(w,b)}\sum_{i = 1}^{m}(y_i-wx_i - y_i)^{2}

        In the regression task, we use mean square error as a measure of performance, so we need to find the minimum mean square error when w and b are equal. This model based on minimizing mean square error is called the "least squares method", where the formula for mean square error corresponds exactly to the Euclidean distance. The purpose of this algorithm is to try to find a line that minimizes the sum of Euclidean distance lines for the sample points.


        The process of solving w and b is actually finding a function

E(w,b)=argmin_{(w,b)}\sum_{i = 1}^{m}(y_i-wx_i - y_i)^{2}

        The process of minimization is called the least squares Parameter Estimation of minimum linear regression.

        Based on the knowledge of advanced mathematics, we can know that for a multivariate function to find its maximum value, it is to take the partial derivative of the parameter and make it 0,then set the partial derivatives to 0 separately, and finally solve for w and b:

        b = \frac{1}{m} \sum_{i = 1}^{m} (y_i - w_i)

w = \frac{ \sum_{i = 1}^{m}y_i(x_i - \bar{x}) }{ \sum_{i = 1}^{m}x_i^{2} - \frac{1}{m}(\sum_{i = 1}^{m}x_i)^{2} }

This is the result we need to seek.

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-16 16:12:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-16 16:12:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-16 16:12:01       82 阅读
  4. Python语言-面向对象

    2024-03-16 16:12:01       91 阅读

热门阅读

  1. 交叉编译代码

    2024-03-16 16:12:01       45 阅读
  2. ChatGPT升级版:如何借助ChatGPT高效撰写学术论文

    2024-03-16 16:12:01       49 阅读
  3. windows各个版本安装SSH

    2024-03-16 16:12:01       43 阅读
  4. CMake官方教程8--自定义命令和生成文件

    2024-03-16 16:12:01       38 阅读
  5. C#面:throw 和throw ex 的区别

    2024-03-16 16:12:01       35 阅读
  6. OpenXR 超详细spec--Chapter 2 基本原理

    2024-03-16 16:12:01       38 阅读
  7. 01、CMD与Hello world

    2024-03-16 16:12:01       37 阅读
  8. leetcode112.路径总和

    2024-03-16 16:12:01       39 阅读