Bruce12138
Machine Learning
Software Enterprise
Graph Theory
Algorithm II
Machine Learning
Software Enterprise
Graph Theory
Algorithm II
  • Machine Learning

    • Introduction
    • Regression
    • Linear Regression 线性回归
    • Loss functions 损失函数

Regression 回归

回归是一种建模方法,用来描述和预测自变量(输入特征)与因变量(输出结果)之间的关系。

Regression is to relate input variables to the output variable, to either predict outputs for new inputs and/or to understand the effect of the input on the output

Dataset for regression 回归的数据集

数据集被分为若干个输入-输出对:

(xn,yn)(\mathbf{x}_n, y_n) (xn​,yn​)

其中:

  • xn\mathbf{x}_nxn​ 是维度为 DDD 的向量,表示第 nnn 个样本的输入特征。
  • yny_nyn​ 是对应的输出标量。
  • 一共有 NNN 对这样的样本对,构成数据集。

因此,数据集可以写成:

D={(xn,yn)}n=1N{\mathcal{D}} = \{ (\mathbf{x}_n, y_n) \}_{n=1}^N D={(xn​,yn​)}n=1N​

进一步,所有输入和输出可以分别写成矩阵和向量形式:

  • 输入矩阵(设计矩阵):

X=[x1Tx2T⋮xNT]∈RN×DX = \begin{bmatrix} \mathbf{x}_1^T \\ \mathbf{x}_2^T \\ \vdots \\ \mathbf{x}_N^T \end{bmatrix} \in \mathbb{R}^{N \times D} X=​x1T​x2T​⋮xNT​​​∈RN×D

  • 输出向量:

y=[y1y2⋮yN]∈RN×1\mathbf{y} = \begin{bmatrix} y_1 \\ y_2 \\ \vdots \\ y_N \end{bmatrix} \in \mathbb{R}^{N \times 1} y=​y1​y2​⋮yN​​​∈RN×1

Two goals of regression 回归的两个目标

  • Prediction 预测

    用模型对新的输入向量预测其输出。利用数据学到的函数关系来对未知数据进行估计

    we wish to predict the output for a new input vector

  • Interpretation 解释

    理解输入变量对输出变量的影响。强调变量之间的因果或统计关系。

    we wish to understand the effect of inputs on output.

The regression function 回归函数

找到一个函数

f:RD→Rf: \mathbb{R}^D\to \mathbb{R} f:RD→R

然后期望它把输入 xn\mathbf{x}_nxn​ 映射到输出 yny_nyn​ 并且与真实输出接近,也即 yn≈f(xn)y_n\approx f(\mathbf{x}_n)yn​≈f(xn​)

那么对于上述的两个目标而言,可以通过 f(xn)f(\mathbf{x}_n)f(xn​) 对某个新的输入进行预测。也可以通过 f(xn)f(\mathbf{x}_n)f(xn​) 的形式(例如大小)理解输入对输出的影响。

**注意: 相关性 ≠\neq= 因果性 **

Last Updated: 9/22/25, 9:03 AM
Contributors: Zhixiang Dai
Prev
Introduction
Next
Linear Regression 线性回归