exploratory-data-analysis-skillhub

An exploratory data analysis skill package for the SkillHub platform.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "exploratory-data-analysis-skillhub" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9fb0f69694b88d484e20c8bd34cf36550e6b6a82b7cef11fcae0784d75d11431. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/exploratory-data-analysis-skillhub before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

An exploratory data analysis skill package for the SkillHub platform.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: 探索性数据分析
description: 在建模之前,对数据集结构、分布、关系和异常进行系统化的探索性数据分析。

Exploratory Data Analysis

此技能使AI代理能够对任何表格数据集执行结构化探索性数据分析(EDA)。该代理系统地分析数据的形状和类型,检查分布,计算相关性,检测异常值,并生成发现摘要。EDA是任何建模或报告之前的关键第一步——它揭示了数据实际包含的内容与假设的内容之间的差异。

Workflow

  1. 加载并检查基本结构。读取数据集并立即报告其形状(行数、列数)、列名、数据类型和内存占用情况。显示前5行和后5行以捕捉标题问题、尾随垃圾行或编码伪影。这在一秒内完成,但可以避免数小时的下游混乱。

  2. 评估数据质量。按绝对值和百分比统计每列中的空值数量。识别方差为零(常数值)的列、高基数分类变量(例如,“备注”字段每行都有唯一值)以及混合类型列。构建一个简洁的质量评分卡:缺失超过5%的列、类型可疑的列,以及重复行的数量。

  3. 分析单个变量的分布。对于数值列,计算均值、中位数、标准差、偏度和峰度。绘制直方图或KDE图。对于分类列,显示前10类的值计数和比例。标记高度不平衡的分布(例如,二元目标变量中一个类别低于5%)。

  4. 探索变量之间的关系。计算数值列的完整相关矩阵,并以热力图形式可视化。对于分类与数值的关系,使用分组箱线图或小提琴图。对于分类与分类的关系,使用列联表或马赛克图。突出显示相关性高于0.7或低于-0.7的配对。

  5. 检测异常值和异常现象。对每个数值列应用IQR方法,并报告异常值的数量和百分比。用箱线图可视化异常值。跨列交叉参考异常值——在多个列中同时为异常值的行通常代表数据录入错误或真正不寻常的观察。

  6. 将发现综合成一份EDA报告。撰写结构化摘要,涵盖:数据集概述、发现的质量问题、关键分布特征、显著相关性、异常值总结以及建议的下一步操作(例如,应删除哪些列、应应用哪些转换、哪些特征可能具有预测性)。

支持的技术

  • pandas — 数据加载和分析
  • matplotlib / seaborn — 分布和相关性可视化
  • ydata-profiling(前身为pandas-profiling)— 自动化EDA报告生成
  • scipy.stats — 分布分析的统计检验

Usage

向代理提供数据集文件路径。可选择指定感兴趣的列、分类变量的最大显示类别数以及是否生成自动化的HTML报告。代理将返回可视化输出和文本形式的发现摘要。

Examples

示例 1:对数据集进行完整EDA

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

df = pd.read_csv("employee_attrition.csv")

# Step 1: Structure
print(f"Shape: {df.shape}")               # Shape: (1470, 35)
print(f"Dtypes:\n{df.dtypes.value_counts()}")
# int64      26
# object      9

# Step 2: Data quality
print(f"\nNull counts:\n{df.isnull().sum().loc[lambda x: x > 0]}")
# monthly_income    12
# years_at_company   8
print(f"Duplicates: {df.duplicated().sum()}")  # Duplicates: 3

# Step 3: Distributions
print(f"\nNumeric summary:\n{df[['age', 'monthly_income', 'years_at_company']].describe()}")
#        age  monthly_income  years_at_company
# mean  36.9         6502.93              7.01
# std    9.1         4707.96              6.13
# min   18.0         1009.00              0.00
# 50%   36.0         4919.00              5.00
# max   60.0        19999.00             40.00

print(f"\nAttrition distribution:\n{df['attrition'].value_counts(normalize=True)}")
# No     0.839
# Yes    0.161    <-- imbalanced target

# Step 4: Correlations
corr = df.select_dtypes(include="number").corr()
high_corr = corr.where(
    (corr.abs() > 0.7) & (corr != 1.0)
).stack().dropna()
print(f"\nHigh correlations:\n{high_corr}")
# monthly_income  job_level           0.95
# total_working_years  job_level      0.78
# years_at_company  years_in_role     0.76

# Step 5: Outlier summary
for col in ["monthly_income", "years_at_company"]:
    Q1, Q3 = df[col].quantile(0.25), df[col].quantile(0.75)
    IQR = Q3 - Q1
    outliers = ((df[col] < Q1 - 1.5 * IQR) | (df[col] > Q3 + 1.5 * IQR)).sum()
    print(f"{col}: {outliers} outliers ({outliers/len(df)*100:.1f}%)")
# monthly_income: 0 outliers (0.0%)
# years_at_company: 47 outliers (3.2%)

# Visualization: correlation heatmap
plt.figure(figsize=(12, 10))
sns.heatmap(corr, cmap="coolwarm", center=0, annot=False, square=True)
plt.title("Feature Correlation Matrix")
plt.tight_layout()
plt.savefig("eda_correlation_heatmap.png", dpi=150)

示例 2:自动生成EDA报告

from ydata_profiling import ProfileReport
import pandas as pd

df = pd.read_csv("employee_attrition.csv")

# Generate a comprehensive HTML report
profile = ProfileReport(
    df,
    title="Employee Attrition EDA Report",
    explorative=True,
    correlations={
        "pearson": {"calculate": True},
        "spearman": {"calculate": True},
        "phi_k": {"calculate": True}
    },
    missing_diagrams={
        "bar": True,
        "matrix": True,
        "heatmap": True
    }
)

profile.to_file("eda_report.html")
# Generates a full interactive report including:
# - Dataset overview (size, types, missing cells, duplicates)
# - Per-variable analysis (stats, histogram, common/extreme values)
# - Correlation matrices (Pearson, Spearman, Phi-K)
# - Missing value patterns (bar chart, matrix, nullity heatmap)
# - Sample rows and duplicate detection
print("Report saved to eda_report.html")

最佳实践

  • 在任何特征工程或建模之前运行EDA——关于数据质量的假设几乎总是错误的,除非经过验证。
  • 可视化分布,而不仅仅是阅读摘要统计;双峰分布和正态分布可能具有相同的均值和标准差。
  • 在EDA期间检查数据泄露问题——如果某个特征与目标变量具有完美或接近完美的相关性,则它可能包含未来信息。
  • 始终检查分布的尾部;最有趣和有问题的数据往往存在于极端值中。
  • 将EDA发现记录在可共享的格式(HTML报告或笔记本)中,以便合作者可以审查你的推理过程。
  • 在主要清理步骤后重新运行EDA,以验证转换是否达到了预期效果。

Edge Cases

  • 包含数百列的数据集。跳过逐列可视化,专注于使用ydata-profiling进行自动化分析。使用相关性阈值仅显示最有趣的配对。
  • 目标变量高度不平衡。明确标记此情况(例如,“只有2.3%的正类”),并建议在下游建模中使用分层采样或重新平衡技术。
  • 全为空值列或零方差列。在EDA过程中自动删除这些列,并在发现中记录它们,因为它们不提供分析价值。
  • 实际为数值的字符串列。检测超过90%的值可解析为数字的列,并建议在进行统计分析前进行类型强制转换。
  • 需要时区感知的日期时间列。当数据集包含来自多个区域的记录时,标记无时区信息的日期时间列,以防止静默聚合错误。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供完整的探索性数据分析工作流,覆盖数据质量评估、分布分析、相关性探索和异常值检测
  • 支持多种技术栈(pandas/seaborn/ydata-profiling),满足不同用户需求
  • 包含端到端代码示例,可直接应用于实际数据集
Trigger Precision90/100

Highlights

  • 触发描述清晰准确,明确针对表格数据集的探索性分析
  • 覆盖多种使用场景(手动分析/自动化报告/自定义参数)
  • 边界定义清晰,避免与其他数据处理工具混淆
Structure and Standards95/100

Highlights

  • 6步工作流结构清晰,逻辑递进完整
  • 提供两个高质量代码示例,涵盖手动分析和自动化报告生成
  • frontmatter完整,文档组织规范,易于理解执行
Execution Reliability90/100

Highlights

  • 使用标准数据科学生态工具,来源可靠
  • 代码示例参数正确,异常处理机制完善
  • 不涉及数据修改操作,执行风险低
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.