You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PyCaret Setup函数Profile属性失效:加载后报告未出现求助

PyCaret 3.3.2中setup函数profile=True无报告显示的解决办法

环境信息

  • Python版本:3.9.19
  • PyCaret版本:3.3.2

问题复现

执行以下代码:

import pycaret
print(pycaret.__version__)  # 输出 '3.3.2'

ClassificationSetup = setup(data = data, target = 'class', 
                   session_id=42,
                   profile=True) 

仅显示Loading profile... Please wait!,预期包含重复值、空值、相关性、直方图等内容的数据概览报告始终未出现。

解决步骤

  • 验证并安装依赖库
    PyCaret的profile功能依赖ydata-profiling,确认已安装兼容版本:

    pip install ydata-profiling>=4.0.0
    

    已安装则尝试升级:

    pip install --upgrade ydata-profiling
    
  • 检查Jupyter环境(若在Notebook运行)
    重启Jupyter内核,确保内核正常连接且允许渲染HTML内容,重新运行代码。

  • 手动生成报告
    若自动加载失败,直接调用ydata-profiling生成并查看报告:

    from ydata_profiling import ProfileReport
    profile = ProfileReport(data, title="Data Profiling Report")
    # 在Notebook内显示
    profile.to_notebook_iframe()
    # 保存为HTML文件本地查看
    profile.to_file("data_profile.html")
    
  • 测试数据子集
    若数据集过大,生成报告耗时过长会导致无响应,先测试数据子集:

    sample_data = data.sample(n=1000, random_state=42)
    ClassificationSetup = setup(data = sample_data, target = 'class', 
                       session_id=42,
                       profile=True) 
    

内容的提问来源于stack exchange,提问作者Samuel Vasco

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 23:45:54