pypcfx-glitch/risk-rule-design 预览 preview

pypcfx-glitch/risk-rule-design

插件Plugin ⭐ 10 MIT other

Rule mining for data risk control, distilled from the ideas of the "100-Day Risk Control Expert" course

编辑导读Editor's Brief

## 核心特性
- 该插件在指定的 X/y 数据集上运行风险规则工作流,完成数据质量检查、单规则挖掘、并行规则集组合和 HTML 报告生成。
- 它注册三个工具:rrd_profiling 用于确认特征并移除 ID、序列号、常量、近唯一或高缺失列;rrd_mining 用于单规则评估和最优规则集组合;rrd_report 用于基于挖掘快照重新生成或调整报告。
- 它提供一个名为 risk-rule-design 的专家技能,包含角色定义、工作流步骤、评估标准和报告结构,供模型或用户调用。
- 挖掘步骤可输出最优组合、HTML 报告和快照,报告步骤可复用该快照重新生成报告。
- 生成的 HTML 报告包含数据集质量检查、单变量规则统计、组合规则指标、全组合排名、散点图和精确率-召回率视图、候选规则池以及附录配置详情。

## 使用场景
- 风控策略人员可以在准备好的样本数据上,用规则挖掘流程替代人工策略调整。
- 数据分析人员可以在为目标变量选择规则组合前,检查特征质量和候选规则。
- 报告使用者可以直接在浏览器中打开自包含 HTML 文件,无需外部资源。

## 技术细节
- 该实现采用 MIT 许可,是纯 JavaScript ESM,零构建步骤且零外部依赖。
- 该包包含一个用于注册工具和技能的入口文件、一个用于 CSV 解析、质量检查、单规则评估和组合搜索的引擎文件,以及一个用于生成内联 CSS 和 SVG 的自包含 HTML 报告文件。
- 安装可以通过 dsh plugin --profile web install 使用 npm 包 dsh-plugin-risk-rule-design,并自动将 bundle 注册到 profile。
- 通过 GitHub 安装会添加依赖,但需要手动将包名追加到 profile bundle 列表,并重启 dsh web

## 注意事项
- README 说明该插件仍在完善中,使用过程中可能存在问题。
- 用户调用该技能时必须提供数据集路径、指定目标字段,并标识要排除的字段。
- GitHub 安装方式不会自动注册 bundle,因此需要手动配置 profile。

## Core Features
- The plugin runs a risk-rule workflow on a specified X/y dataset through data quality checking, single-rule mining, parallel rule-set combination, and HTML report generation.
- It registers three tools: rrd_profiling for confirming features and removing ID, serial number, constant, near-unique, or high-missing columns, rrd_mining for single-rule evaluation and optimal rule-set combination, and rrd_report for regenerating or adjusting a report from a mining snapshot.
- It provides one expert skill named risk-rule-design that contains role definitions, workflow steps, evaluation criteria, and report structure for model or user invocation.
- The mining step can output an optimal combination, an HTML report, and a snapshot, while the report step can reuse the snapshot to regenerate the report.
- The generated HTML report includes dataset quality checks, univariate rule statistics, combination-rule metrics, all-combination ranking, scatter and precision-recall views, candidate rule pools, and appendix configuration details.

## Use Cases
- Risk-control strategy personnel can replace manual strategy adjustment with a rule-mining flow on prepared sample data.
- Data analysis personnel can inspect feature quality and candidate rules before selecting rule combinations for a target variable.
- Report consumers can open the self-contained HTML file directly in a browser without external resources.

## Technical Details
- The MIT-licensed implementation is pure JavaScript ESM with zero build steps and zero external dependencies.
- The package includes an entry file for registering tools and skills, an engine file for CSV parsing, quality checks, single-rule evaluation, and combination search, and a report file for self-contained HTML generation with inline CSS and SVG.
- Installation can use the npm package dsh-plugin-risk-rule-design through dsh plugin --profile web install, which automatically registers the bundle into the profile.
- GitHub installation adds the dependency but requires manually appending the package name to the profile bundle list and restarting dsh web.

## Notes
- The README states that the plugin is still being improved and may have issues during use.
- Users must provide a dataset path, specify the target field, and identify fields to exclude when invoking the skill.
- The GitHub installation path does not automatically register the bundle, so manual profile configuration is required.

安装Install

dsh plugin --profile web add "github:pypcfx-glitch/risk-rule-design"

pypcfx-glitch/risk-rule-design 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

上一个 Prev dsh-bookmarks 下一个 Next dsh-miraculous-standard