当前位置:首页>python>【时间序列机器学习】Python06时间序列XGBoost(eXtreme Gradient Boosting)模型拟合及可视化

【时间序列机器学习】Python06时间序列XGBoost(eXtreme Gradient Boosting)模型拟合及可视化

  • 2026-02-10 09:01:44
【时间序列机器学习】Python06时间序列XGBoost(eXtreme Gradient Boosting)模型拟合及可视化
时间序列机器学习
06时间序列XGBoost(eXtreme Gradient Boosting)模型拟合及可视化
Python(标准化代码)
01
概念、原理、思想、应用

概念:一种梯度提升决策树算法。

原理:通过迭代地添加树,每棵树拟合前一棵树的残差,并使用正则化防止过拟合。

思想: boosting 集成学习,逐步改进模型。

应用:时间序列回归和分类。

可视化:特征重要性图,拟合曲线。

公共卫生意义:高精度预测,可用于疾病暴发预测。

02
操作流程

-数据预处理:

-模型构建:

-训练:

-评估:

-可视化:

-保存结果:

03
代码及操作演示与功能解析

时间序列机器学习模型大致可以分为三类:经典统计模型、传统机器学习模型 和 深度学习模型。

 一、 经典统计模型

这类模型基于序列自身的统计特性(如自相关性、趋势性、季节性)进行建模。

 二、 传统机器学习模型

这类模型将时间序列问题转化为监督学习问题,利用特征工程来捕捉时序模式。

 三、 深度学习模型

这类模型能自动从原始序列数据中学习复杂的时序依赖关系和非线性模式。

时间序列数据的可视化方法

1.  线图: 最基础、最核心的可视化。横轴为时间,纵轴为观测值。用于直观展示趋势、季节性、异常值。

2.  自相关图和偏自相关图:

       ACF: 展示时间序列与其自身各阶滞后之间的相关性。用于识别MA模型的阶数`q`和序列的周期性。

       PACF: 展示在控制中间滞后项后,序列与某阶滞后项之间的纯粹相关性。用于识别AR模型的阶数`p`。

3.  季节图: 将多年的数据按季节周期(如月、周)叠加在一张图上,用于清晰地观察季节性模式以及模式是否随时间变化。

4.  子序列图: 将时间序列分解为多个子序列(如每年的数据),并绘制在同一张图中,便于比较不同周期的模式。

5.  箱线图: 按时间周期(如月份、星期几)对数据进行分组并绘制箱线图,用于观察数据在不同周期内的分布情况(中位数、四分位数、异常值)。

6.  热力图: 常用于展示一天内不同小时、一周内不同天的模式(如网站流量、电力负荷)。

7.  分解图: 将时间序列分解为趋势、季节性 和残差 三个部分,分别进行可视化,帮助我们理解数据的构成。

8.  预测结果对比图: 将历史数据、真实值和模型的预测值绘制在同一张图上,是评估模型性能最直观的方式。

import osimport pandas as pdimport numpy as npimport xgboost as xgbfrom sklearn.metrics import mean_squared_error, mean_absolute_error, r2_scorefrom sklearn.model_selection import train_test_splitimport matplotlib.pyplot as pltimport seaborn as snsimport shapfrom datetime import datetimeimport warningswarnings.filterwarnings('ignore')# 设置中文字体plt.rcParams['font.sans-serif'] = ['SimHei''Microsoft YaHei''DejaVu Sans']plt.rcParams['axes.unicode_minus'] = Falsedef main():# 获取桌面路径    desktop_path = os.path.join(os.path.expanduser("~"), "Desktop")    data_path = os.path.join(desktop_path, "Results时间""combined_weather_disease_data.csv")    results_path = os.path.join(desktop_path, "Results时间XGB")print("开始XGBoost疾病预测建模...")# 检查数据文件是否存在if not os.path.exists(data_path):print(f"错误: 数据文件不存在于 {data_path}")print("请确保桌面上的 'Results时间' 文件夹中包含 'combined_weather_disease_data.csv' 文件")return# 创建子文件夹    subfolders = ["Models""Predictions""Plots""Feature_Importance","Partial_Dependence""SHAP_Analysis"]for folder in subfolders:        folder_path = os.path.join(results_path, folder)if not os.path.exists(folder_path):            os.makedirs(folder_path)# 读取数据    try:print(f"从 {data_path} 读取数据...")        combined_data = pd.read_csv(data_path)        combined_data['timestamp'] = pd.to_datetime(combined_data['timestamp'])print("数据读取成功!")print(f"数据形状: {combined_data.shape}")print(f"数据列名: {list(combined_data.columns)}")    except Exception as e:print(f"读取数据时出错: {e}")return# 选择要建模的疾病    target_diseases = ["influenza""common_cold""pneumonia","bacillary_dysentery""hand_foot_mouth","hemorrhagic_fever"]# 检查目标疾病列是否存在    available_diseases = [disease for disease in target_diseases if disease in combined_data.columns]if not available_diseases:print("错误: 数据中未找到任何目标疾病列")print(f"数据中的列: {list(combined_data.columns)}")returnprint("目标疾病:"", ".join(available_diseases))    def create_features(data):"""特征工程函数"""        df = data.copy()# 时间特征        df['year'] = df['timestamp'].dt.year        df['month'] = df['timestamp'].dt.month        df['day'] = df['timestamp'].dt.day        df['week'] = df['timestamp'].dt.isocalendar().week        df['day_of_week'] = df['timestamp'].dt.dayofweek + 1  # 1-7, 1=周一        df['quarter'] = df['timestamp'].dt.quarter        df['day_of_year'] = df['timestamp'].dt.dayofyear        df['is_weekend'] = (df['day_of_week'].isin([6, 7])).astype(int)# 季节特征        conditions = [            df['month'].isin([12, 1, 2]),            df['month'].isin([3, 4, 5]),            df['month'].isin([6, 7, 8]),            df['month'].isin([9, 10, 11])        ]        choices = ['Winter''Spring''Summer''Fall']        df['season'] = np.select(conditions, choices, default='Unknown')# 滞后特征        lag_periods = [1, 7, 30]        weather_cols = ['temp_mean''humidity_mean''precipitation_total''sunshine_hours']for col in weather_cols:if col in df.columns:for lag in lag_periods:if lag <= 30:  # 避免过多的NA                        df[f'{col}_lag{lag}'] = df[col].shift(lag)# 滚动窗口特征        window_sizes = [7, 30]for col in ['temp_mean''humidity_mean']:if col in df.columns:for window in window_sizes:                    df[f'{col}_rollmean{window}'] = df[col].rolling(window=window, min_periods=1).mean()for window in window_sizes:if'precipitation_total'in df.columns:                df[f'precipitation_rollsum{window}'] = df['precipitation_total'].rolling(window=window,                                                                                         min_periods=1).sum()# 季节性特征        df['sin_day'] = np.sin(2 * np.pi * df['day_of_year'] / 365)        df['cos_day'] = np.cos(2 * np.pi * df['day_of_year'] / 365)        df['sin_week'] = np.sin(2 * np.pi * df['week'] / 52)        df['cos_week'] = np.cos(2 * np.pi * df['week'] / 52)# 为每种疾病创建滞后特征for disease in available_diseases:if disease in df.columns:for lag in [1, 7, 30]:                    df[f'{disease}_lag{lag}'] = df[disease].shift(lag)for window in [7, 30]:                    df[f'{disease}_rollmean{window}'] = df[disease].rolling(window=window, min_periods=1).mean()# 移除由于滞后产生的NA        df = df.dropna()return df# 应用特征工程print("正在进行特征工程...")    featured_data = create_features(combined_data)print(f"特征工程后数据形状: {featured_data.shape}")# 定义基础特征    base_features = [# 气象特征"temp_max""temp_min""temp_mean""temp_median","humidity_max""humidity_min""humidity_mean""humidity_median","wind_max""wind_mean","pressure_max""pressure_min""pressure_mean","precipitation_total""sunshine_hours",# 时间特征"year""month""day""week""day_of_week""day_of_year","is_weekend""quarter",# 气象滞后特征"temp_mean_lag1""temp_mean_lag7""temp_mean_lag30","humidity_mean_lag1""humidity_mean_lag7""humidity_mean_lag30","precipitation_lag1""precipitation_lag7","sunshine_lag1""sunshine_lag7",# 滑动窗口特征"temp_mean_rollmean7""temp_mean_rollmean30","humidity_mean_rollmean7""humidity_mean_rollmean30","precipitation_rollsum7""precipitation_rollsum30",# 季节性特征"sin_day""cos_day""sin_week""cos_week"    ]# 只保留实际存在的特征    base_features = [f for f in base_features if f in featured_data.columns]print(f"可用基础特征数量: {len(base_features)}")# 存储结果    results_summary = []    predictions_list = {}    models_list = {}    feature_importance_list = {}    X_train_list = {}# 对每种疾病进行建模for disease in available_diseases:if disease not in featured_data.columns:print(f"跳过疾病 {disease},数据中不存在该列")continueprint(f"\n正在处理疾病: {disease}")# 添加该疾病的滞后特征        disease_specific_features = base_features + [            f"{disease}_lag1", f"{disease}_lag7", f"{disease}_lag30",            f"{disease}_rollmean7", f"{disease}_rollmean30"        ]# 只保留存在的特征        available_features = [f for f in disease_specific_features if f in featured_data.columns]        available_features.append(disease)# 创建完整数据集        model_data = featured_data[available_features].copy()        model_data = model_data.dropna()if len(model_data) == 0:print(f"  数据不足,跳过疾病 {disease}")continue# 划分训练集和测试集        train_data = model_data[model_data['year'] < 2016]        test_data = model_data[model_data['year'] >= 2016]print(f"  训练集大小: {len(train_data)}, 测试集大小: {len(test_data)}")if len(train_data) == 0 or len(test_data) == 0:print(f"  数据不足,跳过疾病 {disease}")continue# 准备特征矩阵和目标向量        X_train = train_data.drop(columns=[disease])        y_train = train_data[disease]        X_test = test_data.drop(columns=[disease])        y_test = test_data[disease]# 存储训练数据用于后续分析        X_train_list[disease] = X_train# 训练XGBoost模型print("  训练XGBoost模型...")
# 预测        train_pred = xgb_model.predict(dtrain)        test_pred = xgb_model.predict(dtest)# 计算评估指标        train_rmse = np.sqrt(mean_squared_error(y_train, train_pred))        test_rmse = np.sqrt(mean_squared_error(y_test, test_pred))        train_mae = mean_absolute_error(y_train, train_pred)        test_mae = mean_absolute_error(y_test, test_pred)        train_r2 = r2_score(y_train, train_pred)        test_r2 = r2_score(y_test, test_pred)# 存储结果        disease_results = {'Disease': disease,'Train_Size': len(train_data),'Test_Size': len(test_data),'Train_RMSE': train_rmse,'Test_RMSE': test_rmse,'Train_MAE': train_mae,'Test_MAE': test_mae,'Train_R2': train_r2,'Test_R2': test_r2,'Best_Iteration': xgb_model.best_iteration        }        results_summary.append(disease_results)# 存储预测结果# 使用实际日期而不是索引        test_dates = featured_data.loc[            test_data.index, 'timestamp'if'timestamp'in featured_data.columns else test_data.index        pred_df = pd.DataFrame({'Date': test_dates,'Actual': y_test.values,'Predicted': test_pred,'Disease': disease        })        predictions_list[disease] = pred_df# 存储模型和特征重要性        models_list[disease] = xgb_model# 获取特征重要性        importance_dict = xgb_model.get_score(importance_type='gain')        importance_df = pd.DataFrame({'Feature': list(importance_dict.keys()),'Gain': list(importance_dict.values())        }).sort_values('Gain', ascending=False)        feature_importance_list[disease] = importance_df# 可视化图表        try:
# 1. 预测结果对比图            plt.figure(figsize=(12, 6))            plt.plot(pred_df['Date'], pred_df['Actual'], label='真实值', linewidth=2, color='blue')            plt.plot(pred_df['Date'], pred_df['Predicted'], label='预测值', linewidth=2, linestyle='--', color='red')            plt.title(f'{disease} XGBoost预测结果对比\n测试集R² = {test_r2:.3f}, RMSE = {test_rmse:.1f}')            plt.xlabel('日期')            plt.ylabel('病例数')            plt.legend()            plt.xticks(rotation=45)            plt.tight_layout()            plt.savefig(os.path.join(results_path, f'Plots/{disease}_XGB_Results_Comparison.png'), dpi=300)            plt.close()# 2. 特征重要性图            plt.figure(figsize=(10, 6))            top_features = importance_df.head(20)            plt.barh(top_features['Feature'], top_features['Gain'])            plt.title(f'{disease} XGBoost特征重要性 (前20)')            plt.xlabel('Gain')            plt.tight_layout()            plt.savefig(os.path.join(results_path, f'Plots/{disease}_Feature_Importance.png'), dpi=300)            plt.close()# 3. 实际值 vs 预测值散点图            plt.figure(figsize=(8, 6))            plt.scatter(pred_df['Actual'], pred_df['Predicted'], alpha=0.6, color='darkgreen')            min_val = min(pred_df['Actual'].min(), pred_df['Predicted'].min())            max_val = max(pred_df['Actual'].max(), pred_df['Predicted'].max())            plt.plot([min_val, max_val], [min_val, max_val], 'r--', linewidth=2)            plt.title(f'{disease} 实际值 vs 预测值')            plt.xlabel('实际病例数')            plt.ylabel('预测病例数')            plt.tight_layout()            plt.savefig(os.path.join(results_path, f'Plots/{disease}_Actual_vs_Predicted.png'), dpi=300)            plt.close()# 4. 残差图            pred_df['Residuals'] = pred_df['Actual'] - pred_df['Predicted']            plt.figure(figsize=(8, 6))            plt.scatter(pred_df['Predicted'], pred_df['Residuals'], alpha=0.6, color='purple')            plt.axhline(y=0, color='r', linestyle='--', linewidth=2)            plt.title(f'{disease} 残差图')            plt.xlabel('预测值')            plt.ylabel('残差')            plt.tight_layout()            plt.savefig(os.path.join(results_path, f'Plots/{disease}_Residuals.png'), dpi=300)            plt.close()        except Exception as e:print(f"  可视化图表生成失败: {e}")# 保存特征重要性数据        importance_df.to_csv(os.path.join(results_path, f'Feature_Importance/{disease}_Feature_Importance.csv'),                             index=False)# SHAP分析print("  生成SHAP分析图...")        try:            explainer = shap.TreeExplainer(xgb_model)            shap_values = explainer.shap_values(X_train)# SHAP特征重要性图            plt.figure(figsize=(10, 8))            shap.summary_plot(shap_values, X_train, plot_type="bar", show=False)            plt.title(f'{disease} SHAP特征重要性')            plt.tight_layout()            plt.savefig(os.path.join(results_path, f'SHAP_Analysis/{disease}_SHAP_Importance.png'), dpi=300)            plt.close()# SHAP摘要图            plt.figure(figsize=(12, 8))            shap.summary_plot(shap_values, X_train, show=False)            plt.title(f'{disease} SHAP值分布')            plt.tight_layout()            plt.savefig(os.path.join(results_path, f'SHAP_Analysis/{disease}_SHAP_Summary.png'), dpi=300)            plt.close()# 保存SHAP值            shap_df = pd.DataFrame(shap_values, columns=X_train.columns)            shap_df.to_csv(os.path.join(results_path, f'SHAP_Analysis/{disease}_SHAP_Values.csv'), index=False)# 计算SHAP重要性            shap_importance = pd.DataFrame({'Feature': X_train.columns,'Importance': np.mean(np.abs(shap_values), axis=0)            }).sort_values('Importance', ascending=False)            shap_importance.to_csv(os.path.join(results_path, f'SHAP_Analysis/{disease}_SHAP_Importance.csv'),                                   index=False)        except Exception as e:print(f"    SHAP分析失败: {e}")print(f"  {disease} 建模完成")# 保存总体结果if results_summary:        results_df = pd.DataFrame(results_summary)        results_df.to_csv(os.path.join(results_path, "Model_Performance_Summary.csv"), index=False)# 保存预测结果        all_predictions = pd.concat(predictions_list.values(), ignore_index=True)        all_predictions.to_csv(os.path.join(results_path, "Predictions/All_Disease_Predictions.csv"), index=False)# 模型性能比较图        plt.figure(figsize=(12, 8))        results_sorted = results_df.sort_values('Test_R2')# 创建颜色映射        colors = plt.cm.RdYlGn((results_sorted['Test_R2'] - results_sorted['Test_R2'].min()) /                               (results_sorted['Test_R2'].max() - results_sorted['Test_R2'].min()))        bars = plt.bar(range(len(results_sorted)), results_sorted['Test_R2'], color=colors, alpha=0.8)        plt.title('XGBoost模型性能比较 (测试集)')        plt.xlabel('疾病类型')        plt.ylabel('R²')        plt.xticks(range(len(results_sorted)), results_sorted['Disease'], rotation=45)# 添加数值标签for i, bar in enumerate(bars):            height = bar.get_height()            plt.text(bar.get_x() + bar.get_width() / 2., height + 0.01,                     f'{height:.3f}\nRMSE:{results_sorted.iloc[i]["Test_RMSE"]:.1f}',                     ha='center', va='bottom', fontsize=9)        plt.tight_layout()        plt.savefig(os.path.join(results_path, "Plots/Model_Performance_Comparison.png"), dpi=300)        plt.close()# 所有疾病预测结果叠加图        fig, axes = plt.subplots(3, 2, figsize=(14, 12))        axes = axes.flatten()for i, (disease, pred_df) in enumerate(predictions_list.items()):if i < len(axes):                ax = axes[i]                ax.plot(pred_df['Date'], pred_df['Actual'], label='真实值', linewidth=1, alpha=0.7)                ax.plot(pred_df['Date'], pred_df['Predicted'], label='预测值', linewidth=1, linestyle='--', alpha=0.7)                ax.set_title(disease)                ax.set_xlabel('日期')                ax.set_ylabel('病例数')                ax.legend()                ax.tick_params(axis='x', rotation=45)# 隐藏多余的子图for i in range(len(predictions_list), len(axes)):            axes[i].set_visible(False)        plt.suptitle('XGBoost所有疾病预测结果对比 (2016-2025)')        plt.tight_layout()        plt.savefig(os.path.join(results_path, "Plots/All_Diseases_Predictions.png"), dpi=300)        plt.close()
# 特征重要性热力图if len(feature_importance_list) > 0:            try:# 收集所有特征                all_features = set()for imp_df in feature_importance_list.values():                    all_features.update(imp_df['Feature'].head(10).tolist())  # 只取每个疾病的前10个特征# 创建重要性矩阵                importance_matrix = pd.DataFrame(0, index=available_diseases, columns=list(all_features))for disease, imp_df in feature_importance_list.items():                    top_features = imp_df.head(10)  # 只取前10个特征for _, row in top_features.iterrows():if row['Feature'in all_features:                            importance_matrix.loc[disease, row['Feature']] = row['Gain']# 只保留有重要性的特征                non_zero_cols = importance_matrix.sum() > 0                importance_matrix = importance_matrix.loc[:, non_zero_cols]if len(importance_matrix.columns) > 0:                    plt.figure(figsize=(14, 8))                    sns.heatmap(importance_matrix, annot=True, fmt='.3f', cmap='YlOrRd')                    plt.title('XGBoost各疾病特征重要性热力图 (Gain)')                    plt.tight_layout()                    plt.savefig(os.path.join(results_path, "Plots/Feature_Importance_Heatmap.png"), dpi=300)                    plt.close()            except Exception as e:print(f"特征重要性热力图生成失败: {e}")# 保存模型for disease, model in models_list.items():        model.save_model(os.path.join(results_path, f'Models/{disease}_xgb.model'))# 生成最终报告print("\n=== XGBoost建模完成 ===")print(f"建模疾病数量: {len(models_list)}")print("训练集时间范围: 1981-2015")print("测试集时间范围: 2016-2025")print(f"总特征数量: {len(base_features) + len(available_diseases) * 5}\n")if results_summary:        results_df = pd.DataFrame(results_summary)print("模型性能总结:")print(results_df.to_string(index=False))        best_model = results_df.loc[results_df['Test_R2'].idxmax()]        worst_model = results_df.loc[results_df['Test_R2'].idxmin()]print(f"\n最佳性能模型:")print(f"疾病: {best_model['Disease']}, 测试集R²: {best_model['Test_R2']:.3f}, "              f"RMSE: {best_model['Test_RMSE']:.1f}")print(f"\n最差性能模型:")print(f"疾病: {worst_model['Disease']}, 测试集R²: {worst_model['Test_R2']:.3f}, "              f"RMSE: {worst_model['Test_RMSE']:.1f}")# 计算平均性能        avg_r2 = results_df['Test_R2'].mean()        avg_rmse = results_df['Test_RMSE'].mean()print(f"\n平均性能:")print(f"平均测试集R²: {avg_r2:.3f}")print(f"平均测试集RMSE: {avg_rmse:.1f}")print("\n文件输出:")print(f"1. {results_path}/Model_Performance_Summary.csv - 模型性能汇总")print(f"2. {results_path}/Predictions/All_Disease_Predictions.csv - 所有预测结果")print(f"3. {results_path}/Models/ - 所有训练好的XGBoost模型")print(f"4. {results_path}/Plots/ - 各种可视化图表")print(f"5. {results_path}/Feature_Importance/ - 特征重要性数据")print(f"6. {results_path}/Partial_Dependence/ - 部分依赖图")print(f"7. {results_path}/SHAP_Analysis/ - SHAP分析结果")print(f"\n结果文件夹位置: {results_path}")if __name__ == "__main__":    main()

🔍06-时间序列XGBoost模型拟合及可视化

概念:XGBoost是一种基于梯度提升决策树的集成学习算法,应用于时间序列预测时具有高精度和强泛化能力。

原理:通过顺序构建多棵决策树,每棵树学习前一棵树的残差,通过正则化项控制模型复杂度防止过拟合。

思想:"残差学习和模型简化",通过逐步修正前序模型的错误,并结合正则化获得简洁而强大的模型。

应用:高精度时间序列预测竞赛和实际应用,如疾病发病率的精准预测。

可视化:

特征重要性排序图:基于增益、覆盖度等指标的特征重要性

学习曲线:展示模型在训练和验证集上的表现随迭代次数的变化

SHAP值图:解释每个特征对单个预测值的贡献

公共卫生意义:构建高精度疾病预测系统,支持公共卫生资源的精准规划和部署。

医学统计数据分析分享交流SPSS、R语言、Python、ArcGis、Geoda、GraphPad、数据分析图表制作等心得。承接数据分析,论文返修,医学统计,机器学习,生存分析,空间分析,问卷分析业务。若有投稿和数据分析代做需求,可以直接联系我,谢谢!

!!!可加我粉丝群!!!

“医学统计数据分析”公众号右下角;

找到“联系作者”,

可加我微信,邀请入粉丝群!

【医学统计数据分析】工作室“粉丝群”
01
【临床】粉丝群

有临床流行病学数据分析

如(t检验、方差分析、χ2检验、logistic回归)、

(重复测量方差分析与配对T检验、ROC曲线)、

(非参数检验、生存分析、样本含量估计)、

(筛检试验:灵敏度、特异度、约登指数等计算)、

(绘制柱状图、散点图、小提琴图、列线图等)、

机器学习、深度学习、生存分析

等需求的同仁们,加入【临床】粉丝群

02
【公卫】粉丝群

疾控,公卫岗位的同仁,可以加一下【公卫】粉丝群,分享生态学研究、空间分析、时间序列、监测数据分析、时空面板技巧等工作科研自动化内容。

03
【生信】粉丝群

有实验室数据分析需求的同仁们,可以加入【生信】粉丝群,交流NCBI(基因序列)、UniProt(蛋白质)、KEGG(通路)、GEO(公共数据集)等公共数据库、基因组学转录组学蛋白组学代谢组学表型组学等数据分析和可视化内容。

或者可扫码直接加微信进群!!!

精品视频课程-“医学统计数据分析”视频号付费合集

“医学统计数据分析”视频号-付费合集兑换相应课程后,获取课程理论课PPT、代码、基础数据等相关资料,请大家在【医学统计数据分析】公众号右下角,找到“联系作者”,加我微信后打包发送。感谢您的支持!!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-10 12:17:12 HTTP/2.0 GET : https://f.mffb.com.cn/a/474714.html
  2. 运行时间 : 0.157900s [ 吞吐率:6.33req/s ] 内存消耗:4,918.77kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=932bad608d9e02fe49d6f19a8e65c413
  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.000645s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000681s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000289s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000273s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000531s ]
  6. SELECT * FROM `set` [ RunTime:0.000242s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000559s ]
  8. SELECT * FROM `article` WHERE `id` = 474714 LIMIT 1 [ RunTime:0.001181s ]
  9. UPDATE `article` SET `lasttime` = 1770697032 WHERE `id` = 474714 [ RunTime:0.004639s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000268s ]
  11. SELECT * FROM `article` WHERE `id` < 474714 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000951s ]
  12. SELECT * FROM `article` WHERE `id` > 474714 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000484s ]
  13. SELECT * FROM `article` WHERE `id` < 474714 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.015415s ]
  14. SELECT * FROM `article` WHERE `id` < 474714 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.026287s ]
  15. SELECT * FROM `article` WHERE `id` < 474714 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.039808s ]
0.159426s