当前位置:首页>python>Python绘图 | 复现顶刊中机器学习SHAP特征重要性交互网络与个性化解释图(包含完整代码)

Python绘图 | 复现顶刊中机器学习SHAP特征重要性交互网络与个性化解释图(包含完整代码)

  • 2026-03-29 14:02:18
Python绘图 | 复现顶刊中机器学习SHAP特征重要性交互网络与个性化解释图(包含完整代码)
今天要复现的是机器学习解释的SHAP特征重要性交互网络与个性化解释的瀑布图,原图来自今年发表在Environmental Impact Assessment Review杂志上Hidden risks in greening: Unveiling the impact of bare land changes on landscape ecological risks in arid and semi-arid regions of China下面展示了如何用Python复现的过程,包含了绘制的完整Python代码。

用SHAP打破机器学习“黑箱”,核心看两个关键可视化。1. 特征重要性交互网络节点代表各类核心特征,节点大小体现特征重要性,连线强弱反映特征间交互关系,直观呈现多特征协同作用的规律。2. SHAP瀑布图聚焦单一样本,从基线值拆解每个特征对个体的作用,可精准定位关键影响特征。

原文中的结果图:Fig. 12

 先看复现前后的对比图 

1. 特征重要性交互网络图:
2. 个性化解释瀑布图:

Python代码

1. 导入机器学习和绘图python包:
import pandas as pdimport numpy as npimport pickleimport xgboost as xgbimport shapfrom sklearn.ensemble import RandomForestRegressorGradientBoostingRegressorfrom lightgbm import LGBMRegressorimport matplotlib.pyplot as pltimport osimport matplotlib.colors as mcolorsimport networkx as nxfrom sklearn.model_selection import train_test_split, GridSearchCVimport matplotlib.patches as patches
2. 加载数据(可以自行准备自己的数据):
df = pd.read_csv("./data/train.csv")X = df.iloc[:, 4:]  y = df['Yield'].values  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
3. 训练XGBoost模型(模拟的是回归预测):
param = {    'max_depth'6,    'eta'0.036,    'tree_method''hist',    'device''cuda'    }n_trees = 500dmat = xgb.DMatrix(X_train, y_train)best_model  = xgb.train(param, dmat, n_trees)
4. 利用训练的模型计算SHAP值:
explainer= shap.TreeExplainer(best_model)shap_interaction_values= explainer.shap_interaction_values(X_test)shap_values= explainer.shap_values(X_test)
5. 定义一些绘图的元素:
# 全局绘图风格:矢量PDF可编辑 + Arial字体plt.rcParams['font.family'] = 'Arial'plt.rcParams['pdf.fonttype'] = 42plt.rcParams['ps.fonttype'] = 42# 颜色库COLOR_SCHEMES = {    1: {'nodes': plt.cm.Greens, 'edges': plt.cm.Purples,        'bar_pos''#d55e5b''bar_neg''#5b85ba''scatter_color''#e0e0e0'},}scheme_index = 1  # 设置要使用的颜色方案(原代码45超出范围,改为1)current_color_scheme = COLOR_SCHEMES.get(scheme_index, COLOR_SCHEMES[1])  # 提取颜色方案# 形状标记库STYLE_SCHEMES = {    1: {'marker''o''linestyle''-'},}style_index = 1  # 设置要使用的形状方案current_style_scheme = STYLE_SCHEMES.get(style_index, STYLE_SCHEMES[1])  # 提取形状方案
6. 定义特征重要性互作网络函数:
def plot_interaction(    features,    importance,    interaction_matrix,    top_n=None,    node_size_min=220,    node_size_max=2200,    node_size_power=1.15,    edge_width_weak_min=0.5,    edge_width_weak_max=1.1,    edge_width_strong_min=1.6,    edge_width_strong_max=7.6,    edge_highlight_percentile=85,    edge_alpha=0.85,    save_pdf_path=None,):    # 如果指定了top_n,只选择最重要的特征    if top_n is not None and top_n < len(features):        # 先取前top_n,再按重要性从高到低排序,便于阅读        sorted_indices = np.argsort(importance)[-top_n:][::-1]        features = [features[i] for i in sorted_indices]        importance = importance[sorted_indices]        interaction_matrix = interaction_matrix[np.ix_(sorted_indices, sorted_indices)]    cmap_nodes = current_color_scheme['nodes']  # 节点颜色映射    cmap_edges = current_color_scheme['edges']  # 边颜色映射    node_marker = current_style_scheme['marker']  # 节点的标记形状    edge_linestyle = current_style_scheme['linestyle']  # 线条样式    # 创建画布    fig, ax = plt.subplots(figsize=(1210), subplot_kw={'aspect''equal'})    n_features = len(features)  # 特征总数量    # 创建一个 NetworkX 图对象    G = nx.Graph()    G.add_nodes_from(features)  # 向图中添加节点    pos = nx.circular_layout(G)  # 生成节点的环形布局坐标    # 标签的坐标(向外偏移)    label_pos = {k: (v[0] * 1.18, v[1] * 1.18for k, v in pos.items()}    # 归一化(真实值映射:Vimp/Vint 与“实际绘制边”一一对应)    max_imp = float(np.max(importance)) if np.max(importance) > 0 else 1.0    # 只统计将被绘制的边强度(上三角、非对角)    pair_interactions = []    for i in range(n_features):        for j in range(i + 1, n_features):            v = (interaction_matrix[i, j] + interaction_matrix[j, i]) / 2            if v > 0:                pair_interactions.append(v)    pair_interactions = np.array(pair_interactions, dtype=float)    if pair_interactions.size > 0:        edge_vmin = float(np.min(pair_interactions))        edge_vmax = float(np.max(pair_interactions))        if edge_vmax <= edge_vmin:            edge_vmax = edge_vmin + 1e-12    else:        edge_vmin, edge_vmax = 0.01.0    max_interaction = edge_vmax    norm_nodes = mcolors.Normalize(vmin=0, vmax=max_imp)    norm_edges = mcolors.Normalize(vmin=edge_vmin, vmax=edge_vmax)    # 计算高强度边阈值(用于加粗高亮)    edge_highlight_percentile = float(np.clip(edge_highlight_percentile, 0100))    highlight_threshold = (        np.percentile(pair_interactions, edge_highlight_percentile)        if pair_interactions.size > 0 else 0    )    # 参数安全处理    node_size_min = max(float(node_size_min), 1.0)    node_size_max = max(float(node_size_max), node_size_min)    node_size_power = max(float(node_size_power), 0.01)    edge_width_weak_min = max(float(edge_width_weak_min), 0.01)    edge_width_weak_max = max(float(edge_width_weak_max), edge_width_weak_min)    edge_width_strong_min = max(float(edge_width_strong_min), 0.01)    edge_width_strong_max = max(float(edge_width_strong_max), edge_width_strong_min)    edge_alpha = float(np.clip(edge_alpha, 01))    # 节点颜色和大小    node_colors = []    node_sizes = []    for i in range(n_features):        node_colors.append(cmap_nodes(norm_nodes(importance[i])))        # 节点大小可控:最小值 + 缩放范围 * (标准化重要性^指数)        size = node_size_min + (node_size_max - node_size_min) * (importance[i] / max_imp) ** node_size_power        node_sizes.append(size)    # 绘制所有弱交互边(浅色细线)    weak_edges = []    weak_edge_colors = []    weak_edge_widths = []    strong_edges = []    strong_edge_colors = []    strong_edge_widths = []    ##TODO:篇幅问题此处没有完全展示代码,需要定义节点循环    # 绘制节点(实心绿、少量白心)    nx.draw_networkx_nodes(        G, pos, node_color=node_colors, node_size=node_sizes, ax=ax,        alpha=0.98, node_shape=node_marker, linewidths=0.6, edgecolors='#2f2f2f'    )    # 绘制节点标签    nx.draw_networkx_labels(G, label_pos, font_size=11, font_weight='bold', ax=ax, font_family='serif')    # 设置图形属性    ax.axis('off')    ax.set_xlim(-1.551.55)    ax.set_ylim(-1.651.55)    # 设置标题    title_text = 'Impact intensity'    if top_n is not None:        title_text += f' (Top {top_n} Features)'    plt.title(title_text, loc='left', fontsize=12,  pad=14, fontfamily='Arial')    # 颜色条与文字(紧贴网络图并缩小,匹配示例)    sm_node = plt.cm.ScalarMappable(cmap=cmap_nodes, norm=norm_nodes)    sm_node.set_array([])    sm_edge = plt.cm.ScalarMappable(cmap=cmap_edges, norm=norm_edges)    sm_edge.set_array([])    # 节点重要性颜色条(更短、更近)    cax_node = fig.add_axes([0.220.1150.200.016])    cbar_node = plt.colorbar(sm_node, cax=cax_node, orientation='horizontal')    cbar_node.set_ticks(np.linspace(0, max_imp, 6))    cbar_node.ax.tick_params(labelsize=9, rotation=90, pad=2)    cbar_node.outline.set_linewidth(0.8)    # 交互强度颜色条(更短、更近)    cax_edge = fig.add_axes([0.580.1150.200.016])    cbar_edge = plt.colorbar(sm_edge, cax=cax_edge, orientation='horizontal')    cbar_edge.set_ticks(np.linspace(edge_vmin, max_interaction, 4))    cbar_edge.ax.tick_params(labelsize=9, rotation=90, pad=2)    cbar_edge.outline.set_linewidth(0.8)    # 添加色带标题与箭头文字(按示例:两段词 + 实线箭头)    ax.text(0.320.147'Importance', transform=fig.transFigure,            ha='center', va='bottom', fontsize=12, fontfamily='Arial')    ax.text(0.2730.131'Low', transform=fig.transFigure,            ha='right', va='bottom', fontsize=10.5, fontfamily='serif')    ax.text(0.3670.131'High', transform=fig.transFigure,            ha='left', va='bottom', fontsize=10.5, fontfamily='serif')    ax.annotate(        '', xy=(0.3620.134), xytext=(0.2780.134),        xycoords=fig.transFigure, textcoords=fig.transFigure,        arrowprops=dict(arrowstyle='-|>', lw=1.0, color='black', mutation_scale=10)    )    ax.text(0.2150.123'Vimp', transform=fig.transFigure,            ha='right', va='center', fontsize=12, fontfamily='serif')    ax.text(0.680.147'Interaction Intensity', transform=fig.transFigure,            ha='center', va='bottom', fontsize=12, fontfamily='serif')    ax.text(0.6280.131'Weak', transform=fig.transFigure,            ha='right', va='bottom', fontsize=10.5, fontfamily='serif')    ax.text(0.7330.131'Strong', transform=fig.transFigure,            ha='left', va='bottom', fontsize=10.5, fontfamily='serif')    ax.annotate(        '', xy=(0.7280.134), xytext=(0.6330.134),        xycoords=fig.transFigure, textcoords=fig.transFigure,        arrowprops=dict(arrowstyle='-|>', lw=1.0, color='black', mutation_scale=10)    )    ax.text(0.5750.123'Vint', transform=fig.transFigure,            ha='right', va='center', fontsize=12, fontfamily='serif')    plt.tight_layout(rect=[0.020.180.980.98])    if save_pdf_path is not None:        fig.savefig(save_pdf_path, format='pdf', bbox_inches='tight')    plt.show()    return fig, ax
结果如下:
6. 定义个性化解释瀑布图函数:
def plot_waterfall(features, shap_values, expected_value,                                   current_color_scheme, top_n=15,                                   save_pdf_path=None,                                   show_contribution_labels=True,                                   contribution_label_fmt='{:+.3f}',                                   contribution_label_fontsize=9):    mean_shap = np.mean(shap_values, axis=0)    sorted_indices = np.argsort(np.abs(mean_shap))[::-1][:top_n]    sorted_features = [features[i] for i in sorted_indices]    shap_vals = mean_shap[sorted_indices]    if isinstance(expected_value, (list, np.ndarray)):        base_value = float(np.array(expected_value).flatten()[0])    else:        base_value = float(expected_value)    starts, ends = [], []    y_curr = base_value    for v in shap_vals:        starts.append(y_curr)        y_curr += v        ends.append(y_curr)    final_value = y_curr    pos_color = '#f1696d'    neg_color = '#44c3df'    fig, ax = plt.subplots(figsize=(13.86.25), dpi=140)    fig.patch.set_facecolor('white')    ax.set_facecolor('white')    x = np.arange(len(sorted_features))    y_all = [base_value] + starts + ends    y_range = max(np.max(y_all) - np.min(y_all), 1e-6)    bar_w = 0.36    tip_h = 0.085 * y_range  # 箭头尖高度(全局基准)    ## TODO: 篇幅原因,代码没有展示完整,此处需要定义循环展示每个特征的贡献值    # 竖向参考线    for xi in x:        ax.axvline(xi, color='#9a9a9a', linestyle='-', linewidth=0.55, alpha=0.4, zorder=1)    y_min, y_max = min(y_all), max(y_all)    y_span = (y_max - y_min) if y_max > y_min else 1.0    pad = 0.10 * y_span    # 预留额外上下空间,确保两侧文本框始终在坐标轴内部    ax.set_ylim(y_min - pad, y_max + pad)    y_low, y_high = ax.get_ylim()    margin = 0.08 * (y_high - y_low)    # 左右说明框:固定纵向居中(不随数据上下漂移)    center_y = (y_low + y_high) / 2.0    fx_y = center_y    ex_y = center_y    ax.set_xticks(x)    ax.set_xticklabels(sorted_features, rotation=90, fontsize=10, fontfamily='Arial')    # 取消左边框刻度(主轴左侧不显示任何刻度线/标签)    ax.tick_params(axis='y', which='both', left=False, labelleft=False, length=0)    ax.set_ylabel('')    ax_right = ax.twinx()    ax_right.set_ylim(ax.get_ylim())    ax_right.set_ylabel('SHAP value', fontsize=13, fontfamily='Arial')    ax_right.tick_params(axis='y', labelsize=11)    ax_right.yaxis.set_major_locator(plt.MaxNLocator(4))    ax_right.yaxis.set_major_formatter(plt.FormatStrFormatter('%.1f'))    for side in ['left''right''top''bottom']:        ax.spines[side].set_linewidth(1.2)        ax.spines[side].set_color('#2f2f2f')    for sp in ax_right.spines.values():        sp.set_visible(False)    # 左右竖排框注:放在边框外,且始终纵向居中    x_left, x_right = ax.get_xlim()    x_span = x_right - x_left    ex_x = x_left - 0.035 * x_span    fx_x = x_right - 0.020 * x_span    box_kw = dict(facecolor='white', edgecolor='#4a4a4a', boxstyle='square,pad=0.25')    ax.text(ex_x, ex_y, f'E[f(x)]={base_value:.4f}',            rotation=90, va='center', ha='center', fontsize=12, fontfamily='Arial',            bbox=box_kw, clip_on=False)    ax.text(fx_x, fx_y, f'f(x)={final_value:.4f}',            rotation=90, va='center', ha='center', fontsize=12, fontfamily='Arial',            bbox=box_kw, clip_on=True)    ax.set_title('Impact direction', loc='left', fontsize=20, fontfamily='Arial', pad=4)    legend_elements = [        patches.Patch(facecolor=pos_color, edgecolor='#2f2f2f', label='Positive'),        patches.Patch(facecolor=neg_color, edgecolor='#2f2f2f', label='Negative')    ]    legend_y = -0.46    label_fs = 16    # 先放“Impact direction”文字,再让图例紧跟其后,保证三者同一水平线且字号一致    impact_x = 0.42    ax.legend(        handles=legend_elements,        ncol=2,        loc='upper left',        bbox_to_anchor=(impact_x + 0.01, legend_y),        frameon=False,        fontsize=label_fs,        columnspacing=1.2,        handletextpad=0.5,        borderaxespad=0.0,        prop={'family''Arial'}    )    plt.subplots_adjust(bottom=0.44, left=0.10, right=0.88, top=0.88)    if save_pdf_path is not None:        fig.savefig(save_pdf_path, format='pdf', bbox_inches='tight')    plt.show()    return fig, ax
7. 绘图主函数:
if __name__ == "__main__":    # 输出目录(CSV 与 PDF)    output_dir = './outputs'    os.makedirs(output_dir, exist_ok=True)    # 特征名称    features = X.columns.tolist()    # 统一处理shap_values(某些场景下可能返回list)    shap_values_arr = shap_values[0if isinstance(shap_values, listelse shap_values    # 统一处理交互值(某些场景下可能返回list)    shap_interaction_arr = shap_interaction_values[0if isinstance(shap_interaction_values, listelse shap_interaction_values    # 计算一维特征重要性(用于节点大小和颜色)    importance_scaled = np.mean(np.abs(shap_values_arr), axis=0)    # 计算二维平均交互矩阵(用于边)    mean_interaction_matrix = np.mean(np.abs(shap_interaction_arr), axis=0)    # 保存特征重要性排序(CSV)    importance_df = pd.DataFrame({        'feature': features,        'importance': importance_scaled    }).sort_values('importance', ascending=False).reset_index(drop=True)    importance_df.to_csv(        os.path.join(output_dir, 'feature_importance_ranking_all_features.csv'),        index=False,        encoding='utf-8-sig'    )    # 保存两两特征交互值(CSV,上三角去重)    interaction_records = []    for i in range(len(features)):        for j in range(i + 1len(features)):            interaction_strength = (mean_interaction_matrix[i, j] + mean_interaction_matrix[j, i]) / 2            interaction_records.append({                'feature_1': features[i],                'feature_2': features[j],                'interaction_value'float(interaction_strength)            })    interaction_df = pd.DataFrame(interaction_records).sort_values(        'interaction_value', ascending=False    ).reset_index(drop=True)    interaction_df.to_csv(        os.path.join(output_dir, 'pairwise_feature_interactions_all_features.csv'),        index=False,        encoding='utf-8-sig'    )    # 极简可调参数:仅控制特征数量、节点大小、线条粗细    interaction_plot_params = {        'top_n'20,                 # 显示前N个特征        'node_size_min'220,        # 节点最小大小        'node_size_max'2200,       # 节点最大大小        'edge_width_weak_min'1.5,  # 线条最细(弱交互)        'edge_width_weak_max'3.1,  # 线条最粗(弱交互)        'edge_width_strong_min'2.6,# 线条最细(强交互)        'edge_width_strong_max'7.6 # 线条最粗(强交互)    }    # 另外导出“当前绘图所选特征”的重要性与交互值,便于逐项核对    top_n = interaction_plot_params.get('top_n'None)    if top_n is not None and top_n < len(features):        selected_idx = np.argsort(importance_scaled)[-top_n:][::-1]    else:        selected_idx = np.arange(len(features))    selected_features = [features[i] for i in selected_idx]    selected_importance = importance_scaled[selected_idx]    selected_importance_df = pd.DataFrame({        'feature': selected_features,        'importance': selected_importance    }).sort_values('importance', ascending=False).reset_index(drop=True)    selected_importance_df.to_csv(        os.path.join(output_dir, 'feature_importance_ranking_for_plot.csv'),        index=False,        encoding='utf-8-sig'    )    # 只用于画图的特征两两交互值(上三角去重)    selected_interaction_matrix = mean_interaction_matrix[np.ix_(selected_idx, selected_idx)]    selected_interaction_records = []    for i in range(len(selected_features)):        for j in range(i + 1len(selected_features)):            interaction_strength = (selected_interaction_matrix[i, j] + selected_interaction_matrix[j, i]) / 2            selected_interaction_records.append({                'feature_1': selected_features[i],                'feature_2': selected_features[j],                'interaction_value'float(interaction_strength)            })    pd.DataFrame(selected_interaction_records).sort_values(        'interaction_value', ascending=False    ).reset_index(drop=True).to_csv(        os.path.join(output_dir, 'pairwise_feature_interactions_for_plot.csv'),        index=False,        encoding='utf-8-sig'    )    # 调用绘制环形交互图函数并保存矢量PDF    plot_circular_interaction(        features,        importance_scaled,        mean_interaction_matrix,        save_pdf_path=os.path.join(output_dir, 'A_impact_intensity_feature_interaction_network.pdf'),        **interaction_plot_params    )    # 获取模型的基础期望值(模型在整个数据集上的平均预测基准值)    expected_value = explainer.expected_value    # 使用X_train来计算SHAP值    shap_values_train = explainer.shap_values(X_train)    shap_values_train_arr = shap_values_train[0if isinstance(shap_values_train, listelse shap_values_train    # 调用绘制影响方向瀑布图函数并保存矢量PDF    plot_impact_direction_waterfall(        features,        shap_values_train_arr,        expected_value,        current_color_scheme,        top_n=20,        save_pdf_path=os.path.join(output_dir, 'B_impact_direction_waterfall.pdf')    )
好了,本期内容到此结束,喜欢的小伙伴可以转发分享,收藏,别忘了来个三连击啊~~~

以上内容为原创,转载需声明出处。

往期回顾

科研绘图配色 | 不会配色?直接抄作业!Nature/Science/Cell 最新配色指南
Python绘图 | 手把手复现Nature子刊中机器学习模型比较结果图(完整代码+结果解读)
科研绘图配色 | 分享几组Nature文章中实用的单细胞聚类分群图可视化配色
科研绘图配色 | Nature Evo1.5基因组大语言模型文章的作者是懂美学设计的!

参考文献:Yin L, Wei W, Li H, et al. Hidden risks in greening: Unveiling the impact of bare land changes on landscape ecological risks in arid and semi-arid regions of China[J]. Environmental Impact Assessment Review, 2026, 117: 108244.

以上内容为原创,转载需声明出处。

添加小编微信进群交流学习!

🔥亲测有效,一键运行,助你快速上手!

🔥整理不易,欢迎点赞分享给更多小伙伴~ 

#编程干货#数据分析#Python绘图#SCI绘图#CNS

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-29 23:40:49 HTTP/2.0 GET : https://f.mffb.com.cn/a/483829.html
  2. 运行时间 : 0.239052s [ 吞吐率:4.18req/s ] 内存消耗:5,026.22kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=ef9b6cef26e4a317de67a808b73f878e
  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.000941s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001688s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000618s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.006863s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001698s ]
  6. SELECT * FROM `set` [ RunTime:0.000708s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001819s ]
  8. SELECT * FROM `article` WHERE `id` = 483829 LIMIT 1 [ RunTime:0.001542s ]
  9. UPDATE `article` SET `lasttime` = 1774798849 WHERE `id` = 483829 [ RunTime:0.005906s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.001626s ]
  11. SELECT * FROM `article` WHERE `id` < 483829 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001556s ]
  12. SELECT * FROM `article` WHERE `id` > 483829 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002171s ]
  13. SELECT * FROM `article` WHERE `id` < 483829 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.007565s ]
  14. SELECT * FROM `article` WHERE `id` < 483829 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005506s ]
  15. SELECT * FROM `article` WHERE `id` < 483829 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003145s ]
0.242876s