当前位置:首页>python>Python数据分析:用逻辑回归预测泰坦尼克号幸存情况项目实战

Python数据分析:用逻辑回归预测泰坦尼克号幸存情况项目实战

  • 2026-03-09 10:05:13
Python数据分析:用逻辑回归预测泰坦尼克号幸存情况项目实战

🚢 Python数据分析:用逻辑回归预测泰坦尼克号幸存情况项目实战

大家好,我是你们的Python数据分析小伙伴!今天带大家完成一个经典的数据分析项目——泰坦尼克号幸存预测。我们将基于乘客的性别、船舱等级等属性,建立逻辑回归模型,预测每位乘客在沉船事件中是否幸存。

整个过程遵循数据分析的标准流程:读取数据 → 数据清洗 → 数据整理 → 探索性分析 → 建模预测 → 结果解读。让我们开始吧!


📌 分析目标

根据泰坦尼克号乘客的性别、船舱等级、年龄、家庭成员数量等属性,训练一个逻辑回归模型,用来预测未知幸存情况的乘客是否生还。


📖 简介

泰坦尼克号(RMS Titanic)是20世纪初最大的客运轮船,1912年首航时撞上冰山沉没,造成超过1500人遇难,是人类历史上最著名的海难之一。

我们使用的数据集包含两个文件:

  • titanic_train.csv:训练集,包含891名乘客的幸存标签及个人信息。
  • titanic_test.csv:测试集,包含418名乘客的信息(无幸存标签),用于最终预测。

📂 读取数据

首先导入必要的库:numpypandasmatplotlibseaborn

import numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as sns

读取训练数据并预览前5行:

original_titanic_train = pd.read_csv("titanic_train.csv")original_titanic_train.head()

🔍 评估和清理数据

我们将原始数据复制一份用于清洗,避免破坏原始数据。

cleaned_titanic_train = original_titanic_train.copy()

📐 数据整齐度

查看数据前10行,发现符合“每个变量为一列,每个观察值为一行”的原则,没有结构性问题。

cleaned_titanic_train.head(10)

🧹 数据干净度

使用info()查看数据概况:

cleaned_titanic_train.info()

输出显示:AgeCabinEmbarked存在缺失值;PassengerId应为字符串;SurvivedPclassSexEmbarked应为分类变量。

转换数据类型

cleaned_titanic_train['PassengerId'] = cleaned_titanic_train['PassengerId'].astype('str')cleaned_titanic_train['Survived'] = cleaned_titanic_train['Survived'].astype('category')cleaned_titanic_train['Pclass'] = cleaned_titanic_train['Pclass'].astype('category')cleaned_titanic_train['Sex'] = cleaned_titanic_train['Sex'].astype('category')cleaned_titanic_train['Embarked'] = cleaned_titanic_train['Embarked'].astype('category')

再次info()确认。

🕳️ 处理缺失数据

  • Age:有177个缺失值(约占20%)。用平均值填充。
average_age = cleaned_titanic_train['Age'].mean()cleaned_titanic_train['Age'] = cleaned_titanic_train['Age'].fillna(average_age)
  • Cabin:缺失687个,且我们认为船舱号对幸存影响不大,保留缺失。

  • Embarked:仅缺失2个,且登船港口对幸存影响不大,保留缺失。

🔁 处理重复数据

检查PassengerId是否重复,结果为0,无重复。

⚖️ 处理不一致数据

查看分类变量的取值分布,均无异常。

cleaned_titanic_train["Survived"].value_counts()cleaned_titanic_train["Pclass"].value_counts()cleaned_titanic_train["Sex"].value_counts()cleaned_titanic_train["Embarked"].value_counts()

❌ 处理无效或错误数据

describe()查看数值变量的统计信息,数值均在合理范围内。

🧩 整理数据

我们创建一个新变量 FamilyNum,表示同乘家庭成员总数(SibSp + Parch),以便分析家庭成员数量对幸存的影响。

cleaned_titanic_train['FamilyNum'] = cleaned_titanic_train['SibSp'] + cleaned_titanic_train['Parch']

📊 探索数据

通过可视化,初步探索各变量与幸存的关系。

🥧 幸存比例

survived_count = cleaned_titanic_train['Survived'].value_counts()plt.pie(survived_count, labels=survived_count.index, autopct='%.1f%%')plt.show()

结果:遇难者约占61.6%,幸存者约占38.4%,比例约为3:2。

📈 乘客年龄分布

figure, axes = plt.subplots(12)sns.histplot(cleaned_titanic_train, x='Age', ax=axes[0])sns.boxplot(cleaned_titanic_train, y='Age', ax=axes[1])plt.show()

观察:乘客年龄集中在20-40岁,也有不少老人和婴儿。

🎂 年龄与幸存关系

sns.histplot(cleaned_titanic_train, x='Age', hue='Survived', alpha=0.4)plt.show()

发现:婴儿幸存比例较高,其他年龄段遇难者更多。

💰 船票金额分布

figure, axes = plt.subplots(12, figsize=[157])sns.histplot(cleaned_titanic_train, x='Fare', ax=axes[0])sns.boxplot(cleaned_titanic_train, y='Fare', ax=axes[1])plt.show()

观察:票价呈右偏分布,多数票价中等,少数极高。

🛳️ 船舱等级与幸存

figure, axes = plt.subplots(12)pclass_count = cleaned_titanic_train['Pclass'].value_counts()axes[0].pie(pclass_count, labels=pclass_count.index)sns.countplot(cleaned_titanic_train, x='Pclass', hue='Survived', ax=axes[1])plt.show()

发现:一等舱幸存比例高,三等舱遇难比例高。

👫 性别与幸存

figure, axes = plt.subplots(12)sex_count = cleaned_titanic_train['Sex'].value_counts()axes[0].pie(sex_count, labels=sex_count.index)sns.countplot(cleaned_titanic_train, x='Survived', hue='Sex', ax=axes[1])plt.show()

发现:女性幸存比例远高于男性。

🚢 登船港口与幸存

figure, axes = plt.subplots(12)embarked_count = cleaned_titanic_train['Embarked'].value_counts()axes[0].pie(embarked_count, labels=embarked_count.index)sns.countplot(cleaned_titanic_train, x='Embarked', hue='Survived', ax=axes[1])plt.show()

发现:瑟堡(C)登船的乘客幸存较多,南安普敦(S)和皇后镇(Q)反之。

👨‍👩‍👧 家庭成员数量与幸存

figure, axes = plt.subplots(12)familyNum_count = cleaned_titanic_train['FamilyNum'].value_counts()axes[0].pie(familyNum_count, labels=familyNum_count.index)sns.countplot(cleaned_titanic_train, x='FamilyNum', hue='Survived', ax=axes[1])plt.show()

发现:独身乘客遇难多;家庭成员1-3人幸存较多;超过3人遇难增多。


📈 分析数据——建立逻辑回归模型

准备数据

创建lr_titanic_train副本,并移除无关变量。

lr_titanic_train = cleaned_titanic_train.copy()lr_titanic_train = lr_titanic_train.drop(['PassengerId''Name''Ticket''Cabin''Embarked'], axis=1)

生成虚拟变量

PclassSex进行独热编码(去掉第一个类别避免多重共线性)。

lr_titanic_train = pd.get_dummies(lr_titanic_train, drop_first=True, columns=['Pclass''Sex'], dtype=int)

划分因变量和自变量

y = lr_titanic_train['Survived']X = lr_titanic_train.drop(['Survived'], axis=1)

检查多重共线性

查看自变量之间的相关系数矩阵。

X.corr()

发现SibSpFamilyNum相关性高达0.89,ParchFamilyNum相关性0.78,接近0.8。为避免共线性,移除SibSpParch,保留FamilyNum

X = X.drop(['Parch''SibSp'], axis=1)

添加截距项

import statsmodels.api as smX = sm.add_constant(X)

第一次拟合模型

model = sm.Logit(y, X).fit()model.summary()

输出显示Fare的p值=0.190 > 0.05,不显著,将其移除。

第二次拟合模型(移除Fare)

X = X.drop(['Fare'], axis=1)model = sm.Logit(y, X).fit()model.summary()

所有变量p值均小于0.05,模型收敛,伪R方为0.3323。

解释模型系数

计算各变量的优势比(exp(coef)):

# Agenp.exp(-0.0395)   # 0.9613 → 年龄每增加1岁,幸存概率降低约4%# FamilyNumnp.exp(-0.2186)   # 0.8036 → 每多1位家庭成员,幸存概率降低约20%# Pclass_2np.exp(-1.1798)   # 0.3073 → 二等舱幸存概率比一等舱低约69%# Pclass_3np.exp(-2.3458)   # 0.0958 → 三等舱幸存概率比一等舱低约90%# Sex_malenp.exp(-2.7854)   # 0.0617 → 男性幸存概率比女性低约94%

结论

  • 年龄小、女性、船舱等级高、家庭成员少的乘客幸存概率更高。
  • 这与历史事件中“妇女儿童优先”及舱位特权相符。

🔮 对测试集进行预测

读取测试数据

titanic_test = pd.read_csv("titanic_test.csv")titanic_test.info()

测试集有418条记录,Age缺失86条,Fare缺失1条。

处理缺失值

Age均值填充年龄缺失。

titanic_test['Age'] = titanic_test['Age'].fillna(titanic_test['Age'].mean())

设置分类变量的类别(防止虚拟变量遗漏)

titanic_test['Pclass'] = pd.Categorical(titanic_test['Pclass'], categories=['1''2''3'])titanic_test['Sex'] = pd.Categorical(titanic_test['Sex'], categories=['female''male'])titanic_test['Embarked'] = pd.Categorical(titanic_test['Embarked'], categories=['C''Q''S'])

生成虚拟变量

titanic_test = pd.get_dummies(titanic_test, drop_first=True, columns=['Pclass''Sex'], dtype=int)

创建家庭人数变量

titanic_test['FamilyNum'] = titanic_test['SibSp'] + titanic_test['Parch']

准备预测输入

X_test = titanic_test[['Age''FamilyNum''Pclass_2''Pclass_3''Sex_male']]X_test = sm.add_constant(X_test)

预测幸存概率

predicted_value = model.predict(X_test)predicted_value

二分类结果(概率≥0.5为幸存)

predicted_value > 0.5

最终得到了418名乘客的预测结果。


🎯 总结

通过本次项目,我们完整经历了数据分析的各个环节,从数据清洗、探索性分析到逻辑回归建模与预测。最终模型揭示了影响泰坦尼克号幸存的关键因素:性别、年龄、船舱等级、家庭成员数量。这些发现不仅验证了历史事实,也展示了数据科学的魅力。


💡 完整代码及数据可在公众号后台回复「泰坦尼克号」获取。

如果你对代码细节感兴趣,欢迎留言交流!我们下次见~ 🚀


最新文章

随机文章

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