当前位置:首页>学习笔记>吴恩达机器学习课程学习笔记 Vol.2 | 线性回归→逻辑回归→过拟合防治

吴恩达机器学习课程学习笔记 Vol.2 | 线性回归→逻辑回归→过拟合防治

  • 2026-04-25 20:28:36
吴恩达机器学习课程学习笔记 Vol.2 | 线性回归→逻辑回归→过拟合防治

本期核心学习内容:从零实现线性回归与逻辑回归,并学会用正则化对抗过拟合。掌握从预测房价识别邮件的核心算法,并获得一套可直接运行的代码。

如果你正尝试用代码预测房价,或者判断一封邮件是不是垃圾邮件,那么你已经在处理监督学习的核心任务了。简单来说,监督学习就是:给你一堆已知答案的“例题”(训练集),让你学会从问题(输入特征 x)到答案(输出标签 y)的映射规则(模型 F(x))。这规则主要干两件事:回归(预测连续值,比如房价)和分类(预测离散标签,比如“是/否”垃圾邮件)。

本期笔记将带你走通这条核心路径:从线性回归出发,用梯度下降找到最佳拟合线;通过特征工程提升性能;再进入逻辑回归,让模型学会做二分类决策;最后,识别并解决模型“学傻了”(过拟合)的问题。以下是学习路线图:

开篇与目录:从回归到分类,建立你的第一个AI模型

线性回归:用梯度下降找到那条“最佳直线”

工程化技巧:特征缩放、学习率与多项式回归

逻辑回归:让模型学会说“是”或“否”

过拟合防治:识别模型“学傻了”并开出药方

实战工具箱:即拿即用的Python代码模板

学习复盘与展望:我的三点“原来如此”


线性回归:用梯度下降找到那条“最佳直线”

想象你要根据房屋面积预测房价。线性回归假设两者关系是一条直线,其模型为:

$$F_{w,b}(x) = w x + $$

其中,w 是权重(斜率),b 是偏差(截距)。我们的目标是找到一对完美的 w 和 b,让这条直线最贴合所有数据点。

如何衡量“贴合”程度?这就需要代价函数,这里使用最直观的均方误差

$$J(w,b) = \frac{1}{2m} \sum_{i=1}^{m} (F(x^{(i)}) - y^{(i)})^$$

m 是样本数。代价函数 J 的值越小,说明模型的预测误差越小,拟合得越好。我们的任务转化为一个优化问题:找到使 J(w,b) 最小的 w 和 b

这时,梯度下降算法登场了。它就像一个人站在山顶(高代价点),通过感知最陡的下坡方向(梯度),一步步往山谷(最低代价点)走。参数的更新规则是:

$$w = w - \alpha \frac{\partial J}{\partial w$$$$b = b - \alpha \frac{\partial J}{\partial b$$

其中,学习率 α 控制着每一步的步长。我们使用的批量梯度下降,意味着每一步更新都计算所有训练样本的梯度,虽然计算量大,但方向最准。

核心三要素

梯度下降更新

当特征不止一个时(如预测房价时还需考虑卧室数、房龄),就进入了多元线性回归。此时,模型变为 $$F_{\mathbf{w},b}(\mathbf{x}) = \mathbf{w} \cdot \mathbf{x} + $$。这里,向量化变得至关重要。用 NumPy 的 np.dot(w, x) 替代 for 循环,不仅能大幅提升代码效率,还能利用GPU的并行计算能力,这是工程实践中的必备技巧。

工程化技巧:特征缩放、学习率与多项式回归

理论上有了梯度下降,但在实际训练中,你可能会发现它收敛得奇慢无比,或者根本不稳定。问题往往出在数据本身。

特征缩放是加速梯度收敛的关键预处理步骤。如果特征 x1(房屋面积,范围0-2000)和 x2(卧室数量,范围1-5)的量纲差异巨大,代价函数的“等高线”会变得又扁又长,梯度下降只能沿着狭窄的山谷缓慢“之”字形下降。通过缩放,让所有特征处于相近的数值范围,等高线会更接近圆形,梯度下降能直指圆心。

常用缩放方法有三种:

  • 除以最大值x_scaled = x / max(x)。简单,但对异常值敏感。

  • 均值归一化x_scaled = (x - mean(x)) / (max(x) - min(x))。将数据缩放到大约[-1, 1]区间。

  • Z-Score标准化x_scaled = (x - mean(x)) / std(x)。最常用,处理后数据均值为0,标准差为1。

学习率 α 的选择是一门艺术。α 太小,收敛慢如蜗牛;α 太大,可能越过最低点甚至发散。一个实用的策略是尝试一系列呈3倍增长的值:0.001, 0.003, 0.01, 0.03, 0.1,并绘制代价函数随迭代次数的下降曲线,选择那条下降最快且平稳的曲线对应的 α

如果你的数据明显不是直线关系怎么办?特征工程多项式回归提供了解决方案。例如,预测房价时,与其单独用宽度 x1 和深度 x2,不如创造一个新特征“面积” x3 = x1 * x2,这往往更具预测力。更进一步,我们可以使用多项式回归,如二次模型 $$F(x) = w_1 x + w_2 x^2 + $$ 或三次模型来拟合曲线。切记:引入了 x^2x^3 这些特征后,它们的值域差异会变得巨大,因此特征缩放是多项式回归前的强制步骤

逻辑回归:让模型学会说“是”或“否”

当预测目标不再是连续数值,而是“是/否”(如垃圾邮件、肿瘤恶性)这样的二分类问题时,线性回归就力不从心了。逻辑回归是解决二分类问题的利器。

它的核心在于 Sigmoid函数(或Logistic函数):

这个函数能将任何实数 z 平滑地映射到 (0, 1) 区间。我们将线性回归的输出 z = w·x + b 送入Sigmoid函数,得到逻辑回归模型:

此时,模型的输出 f(x) 具有了概率意义,表示“y=1”的可能性。通常,我们设定一个阈值(如0.5):若 f(x) >= 0.5,则预测 y=1;反之预测 y=0。这个阈值对应的边界 w·x + b = 0,就是模型的决策边界,它可能是一条直线、一个圆或更复杂的形状,取决于特征。

逻辑回归不能再用均方误差作为代价函数,因为那会导致优化地形凹凸不平(非凸),容易陷入局部最优。为此,我们引入了交叉熵损失函数

这个函数的设计非常巧妙:当真实标签 y=1 时,-log(f(x)) 会惩罚预测概率 f(x) 小的模型;当 y=0 时,-log(1-f(x)) 会惩罚预测概率 f(x) 大的模型。它保证了代价函数是凸的,梯度下降可以找到全局最优解。其梯度下降更新公式与线性回归形式相似,但 f(x) 的定义已替换为Sigmoid函数输出。

过拟合防治:识别模型“学傻了”并开出药方

训练模型时,我们最怕两种“病”:欠拟合过拟合

欠拟合(高偏差)

  • 训练误差大

  • 验证误差大

  • 模型太简单,无法捕捉数据规律

  • 好比只用直线去拟合抛物线

过拟合(高方差)

  • 训练误差小

  • 验证误差大

  • 模型太复杂,连噪声都记住了

  • 好比用高阶多项式完美穿过每一个数据点(包括噪声点)

解决过拟合,通常有三剂“药方”:

  1. 获取更多训练数据:最有效,但成本可能最高。

  2. 减少特征数量:手动选择或使用模型选择算法,降低模型复杂度。

  3. 正则化:在不大幅减少特征的前提下,限制模型复杂度。最常用的是 L2正则化(权重衰减)。

L2正则化的思想是在原来的代价函数上,增加一个与参数 w 的平方成正比的惩罚项:

这里的 λ 是正则化参数,控制惩罚力度。λ 太大,所有 w 被压向0,导致欠拟合;λ 太小,则正则化效果微弱。这个惩罚项会促使梯度下降算法在学习过程中倾向于选择更小的 w 值,从而削弱一些不重要的特征对模型的影响,防止模型过于依赖训练数据中的某些特定细节(噪声),提升泛化能力。

实战工具箱:即拿即用的Python代码模板

理论终需实践。以下是为本期的核心算法准备的Python代码模板,你可以直接复制使用。

1. Z-Score特征标准化函数这是加速梯度下降的必备预处理步骤。

import numpy as npdef normalize_features(X):    """    对特征矩阵X进行Z-Score标准化。    参数:        X: (m, n) 维特征矩阵,m为样本数,n为特征数。    返回:        X_norm: 标准化后的特征矩阵。        mu: 每个特征的均值。        sigma: 每个特征的标准差。    """    mu = np.mean(X, axis=0)          # 计算每个特征的均值    sigma = np.std(X, axis=0)        # 计算每个特征的标准差    X_norm = (X - mu) / sigma        # Z-Score标准化    return X_norm, mu, sigma

2. Sigmoid函数逻辑回归的核心激活函数。

def sigmoid(z):    """    计算Sigmoid函数值。    参数:        z: 标量或numpy数组。    返回:        g: Sigmoid(z)的值。    """    g = 1 / (1 + np.exp(-z))    return g

3. 代价函数计算(含正则化选项)这里提供了逻辑回归的交叉熵损失函数,并可选L2正则化。

def compute_cost(X, y, w, b, lambda_=0):    """    计算逻辑回归的代价函数(交叉熵损失)。    参数:        X: (m,n) 特征矩阵。        y: (m,) 标签向量,值为0或1。        w: (n,) 权重向量。        b: 标量,偏置。        lambda_: 正则化参数,默认为0(无正则化)。    返回:        total_cost: 标量,总代价。    """    m = X.shape[0]    f_wb = sigmoid(np.dot(X, w) + b)  # 模型预测值    # 计算交叉熵损失    cost = -y * np.log(f_wb) - (1 - y) * np.log(1 - f_wb)    total_cost = np.sum(cost) / m    # 添加L2正则化项(不惩罚偏置b)    if lambda_ > 0:        reg_cost = (lambda_ / (2 * m)) * np.sum(w**2)        total_cost += reg_cost    return total_cost

4. 梯度下降函数(含正则化选项)通用的梯度下降优化框架,适用于线性回归和逻辑回归(需搭配对应的代价和梯度计算函数)。

def gradient_descent(X, y, w_in, b_in, cost_function, gradient_function, alpha, num_iters, lambda_=0):    """    执行批量梯度下降以学习参数 w 和 b。    参数:        X: (m,n) 特征矩阵。        y: (m,) 标签向量。        w_in: (n,) 初始权重向量。        b_in: 初始偏置。        cost_function: 计算代价的函数。        gradient_function: 计算梯度的函数。        alpha: 学习率。        num_iters: 迭代次数。        lambda_: 正则化参数,默认为0。    返回:        w: 学习到的权重。        b: 学习到的偏置。        J_history: 每次迭代的代价历史记录。    """    m = len(X)    J_history = []    w = w_in.copy()  # 避免修改输入参数    b = b_in    for i in range(num_iters):        # 计算梯度和代价        dj_dw, dj_db = gradient_function(X, y, w, b, lambda_)        # 更新参数        w = w - alpha * dj_dw        b = b - alpha * dj_db        # 记录代价(为节省计算,每100次迭代记录一次)        if i % 100 == 0:            cost = cost_function(X, y, w, b, lambda_)            J_history.append(cost)            # 可选:打印进度            # if i % 1000 == 0:            #     print(f"Iteration {i:4d}: Cost {cost:.6f}")    return w, b, J_history

学习复盘与展望:我的三点“原来如此”

学完这一章,我有三点豁然开朗的收获:

  1. 代价函数与梯度下降,原来是“教练”与“寻路算法”。以前觉得代价函数和梯度下降是分开的两个概念。现在明白了,代价函数 J 就是那个严格且量化的“教练”,它用明确的数学公式(如均方误差、交叉熵)给模型的每次预测打分。而梯度下降则是那个不知疲倦的“寻路者”,它唯一的目标就是听从教练的指示(梯度),在参数空间里找到让分数(代价)最低的那个点。二者缺一不可。

  2. Sigmoid函数,让分类问题变得“可导”。线性回归的输出是任意实数,直接用于分类(0/1)会非常生硬。Sigmoid函数的精妙之处在于,它作为一个平滑的“激活函数”,将线性输出压缩到(0,1)区间并赋予概率意义。更重要的是,它处处可导,这使得我们能够继续使用梯度下降这套强大的优化工具来解决分类问题。没有它,从回归到分类的桥梁就断了。

  3. 正则化不是让模型变差,而是给它戴上“防沉迷系统”。最初觉得在代价函数里加个惩罚项,是故意不让模型学好。现在懂了,过拟合的模型就像一个沉迷于记忆训练题细节而不会举一反三的学生。正则化,特别是L2正则化,就像一套“防沉迷系统”。它不阻止模型学习,而是温和地提醒它:“不要过度依赖某几个特别复杂的特征(对应大的 w 值),要更均衡、更泛化地看待问题。” 它的目标不是降低训练集上的分数,而是为了在未知的考试(测试集)上考得更好。

练习建议

  1. 立即动手:将本文的代码模板复制到Jupyter Notebook或任何Python环境中运行,尝试用你自己的数据或公开数据集(如波士顿房价、鸢尾花数据集)进行实验。

  2. 参数调优:故意调整学习率 α(试试0.001和0.1),观察梯度下降的收敛速度与稳定性变化;在逻辑回归中调整正则化参数 λ,观察决策边界如何变得“更简单”或“更复杂”。

  3. 完成课程练习:强烈建议同步完成吴恩达教授课程在Coursera或网易云课堂上的配套编程练习,那里的作业设计能帮你巩固每一个细节。

本文核心内容基于2026年4月25日的学习讨论,详细会议妙记可参考:吴恩达AI learning

Part 2|机器学习专业英语:让 AI 学习与英语提升同步进行

📖 重点词汇精讲

A. 核心专业词汇(必记)

英文词汇

音标

词性

中文释义

课程原句

linear regression

/ˈlɪniər rɪˈɡreʃn/

n.

线性回归

"fitting a straight line to your data is linear regression"

supervised learning

/ˈsuːpəvaɪzd ˈlɜːnɪŋ/

n.

监督学习

"we call this supervised learning"

training set

/ˈtreɪnɪŋ set/

n.

训练集

"the data set used to train the model is called a training set"

feature

/ˈfiːtʃər/

n.

特征

"the input variable is also called a feature"

target variable

/ˈtɑːɡɪt ˈveəriəbl/

n.

目标变量

"the output variable is called the target variable"

cost function

/kɒst ˈfʌŋkʃn/

n.

代价函数

"construct a cost function"

parameters

/pəˈræmɪtərz/

n.

参数

"w and b are called the parameters of the model"

prediction

/prɪˈdɪkʃn/

n.

预测

"output an estimate or prediction"

regression

/rɪˈɡreʃn/

n.

回归

"addressing what's called a regression problem"

classification

/ˌklæsɪfɪˈkeɪʃn/

n.

分类

"the other type is called a classification model"

B. 高频学术表达(提升英语表达)

英文表达

中文含义

使用场景

fit a straight line to data

用直线拟合数据

描述线性回归

the right answers are given

给出了正确答案

描述监督学习

makes a prediction for

对…进行预测

描述模型输出

measure how well…fits

衡量…拟合程度

描述代价函数

minimize the cost function

最小化代价函数

描述优化目标

squared error

平方误差

描述误差计算

by convention

按照惯例

介绍约定做法

in contrast with / in other words / that is

与…相比 / 换句话说 / 即

进行对比说明 / 解释说明

C. 数学英语表达(做题/论文必备)

数学表达

英文读法

f(x) = wx + b

"f of x equals w times x plus b"

ŷ

"y hat"

x⁽ⁱ⁾

"x superscript i in parentheses"

Σ

"sum from i equals 1 to m"

minimize J(w,b)

"minimize J as a function of w and b"

J = 0

"the cost J is equal to zero"


🎙️ 英语原文精读(建议大声朗读)

朗读建议:每天花5分钟,大声朗读以下段落。注意专业词汇的发音和语调。

【段落一:线性回归的定义与应用】

"Fitting a straight line to your data is probably the most widely used learning algorithm in the world today. Say you want to predict the price of a house based on the size of a house. We're going to use the data set on house sizes and prices from Portland. Each data point, each of these little crosses, is a house with a size and a price that it most recently was sold for."

【段落二:监督学习的定义】

"This is an example of what's called a supervised learning model. We call this supervised learning because you are first training a model by giving data that has the right answers, because you give the model examples of houses with both the size of the house as well as the price. The model should predict for each house the price — that is, the right answers are given for every house in the data set."

【段落三:模型函数与预测】

"The job of f is to take the new input x and output an estimate or prediction, which I'm gonna call y hat. In machine learning, the convention is that y hat is the estimate or the prediction for y. The function f is called the model, x is called the input or the input feature, and the output of the model is the prediction y hat. When the symbol is just a letter y, then that refers to the target, which is the actual true value in the training set."

【段落四:代价函数的构建】

"The cost function takes the prediction y hat and compares it to the target y by taking y hat minus y. This difference is called the error — we're measuring how far off the prediction is from the target. By convention, we will compute the average squared error instead of the total squared error, and we do that by dividing by m. The extra division by two is just meant to make some of our later calculations a little bit neater."

【段落五:线性回归的目标】

"Linear regression will try to find values for w and b that make J of w, b as small as possible. Choosing a value of w that causes J of w to be as small as possible seems like a good bet. J is the cost function that measures how big the squared errors are, so choosing w that minimizes these squared errors makes them as small as possible, which would give us a good model."


第三部分:知识总结

🗺️ 完整知识图谱

机器学习基础└── 监督学习(Supervised Learning)    ├── 回归(Regression)← 本节重点    │   └── 线性回归(Linear Regression)    │       ├── 模型:f(x) = wx + b    │       │   ├── 参数 w(斜率/权重)    │       │   └── 参数 b(截距/偏置)    │       ├── 数据表示    │       │   ├── 训练集 {(x⁽ⁱ⁾, y⁽ⁱ⁾)},i=1...m    │       │   ├── 输入特征 x    │       │   ├── 真实值 y(target)    │       │   └── 预测值 ŷ(prediction)    │       └── 代价函数 J(w,b)    │           ├── 均方误差MSE    │           ├── J = (1/2m)Σ(ŷ-y)²    │           └── 目标:minimize J(w,b)    └── 分类(Classification)← 后续课程        └── 输出离散类别(猫/狗,有病/无病)

✅ 本节学习检查清单

  • [ ] 能用自己的话解释"监督学习"是什么

  • [ ] 知道线性回归模型的公式 f(x) = wx + b

  • [ ] 理解 y 和 ŷ 的区别

  • [ ] 能写出均方误差代价函数的公式

  • [ ] 理解为什么要最小化代价函数

  • [ ] 能区分回归问题和分类问题

  • [ ] 大声朗读了英语原文精读(至少一遍)

  • [ ] 记住了至少5个本节关键词汇

🤔 思考题(课后练习)

  1. 基础:如果一个模型对所有房子都预测同一个价格(比如$200K),它的代价函数值会很大还是很小?为什么?

  2. 进阶:代价函数 J(w,b) 是关于 w 和 b 的三维曲面,你能想象它大概是什么形状吗?(提示:下节课有3D可视化)

  3. 英语:用英文写一句话,解释什么是 cost function。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-25 20:53:51 HTTP/2.0 GET : https://67808.cn/a/483852.html
  2. 运行时间 : 0.093188s [ 吞吐率:10.73req/s ] 内存消耗:4,536.98kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=3a18583eaa747e1a598e0778128afc3f
  1. /yingpanguazai/ssd/ssd1/www/no.67808.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/no.67808.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/no.67808.cn/runtime/temp/6df755f970a38e704c5414acbc6e8bcd.php ( 12.06 KB )
  140. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000374s ] mysql:host=127.0.0.1;port=3306;dbname=no_67808;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000603s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000273s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000254s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000476s ]
  6. SELECT * FROM `set` [ RunTime:0.000195s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000608s ]
  8. SELECT * FROM `article` WHERE `id` = 483852 LIMIT 1 [ RunTime:0.003438s ]
  9. UPDATE `article` SET `lasttime` = 1777121631 WHERE `id` = 483852 [ RunTime:0.003146s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.000292s ]
  11. SELECT * FROM `article` WHERE `id` < 483852 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000462s ]
  12. SELECT * FROM `article` WHERE `id` > 483852 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.003458s ]
  13. SELECT * FROM `article` WHERE `id` < 483852 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.004391s ]
  14. SELECT * FROM `article` WHERE `id` < 483852 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002615s ]
  15. SELECT * FROM `article` WHERE `id` < 483852 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003751s ]
0.094609s