analytics
Guides SecretFlow preprocessing, statistics, and classical ML workflows that use the direct Python APIs.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- analytics
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides SecretFlow preprocessing, statistics, and classical ML workflows that use the direct Python APIs.
- disable-model-invocation
- true
02 资源文件 2
- 参考文档references/analytics.md3.8 KB
- 脚本scripts/analytics_smoke.py1.1 KB
03 SKILL.md 正文
Analytics
Use this sub-skill when the task is about direct SecretFlow preprocessing, statistics, or classical ML APIs rather than the component CLI.
Owns
- preprocessing helpers such as
StandardScaler - statistics helpers such as
psi_eval, table statistics, and score-card flows - direct ML classes in
secretflow.ml.linear,secretflow.ml.cluster,secretflow.ml.naive_bayes,secretflow.ml.gaussian_process, andsecretflow.ml.neighbors - training / prediction workflows that use the direct Python APIs
- common optional-dependency and SPU configuration failures
Does not own
- component CLI / component export workflows — use
component-cli - device/object setup and federated containers — use
runtime-data - PSI deployment, Kuscia, or TEEU orchestration — use
privacy-orchestration
Trigger phrases
Use this route when a user asks things like:
- how to scale or preprocess federated data
- how to compute PSI or score-card metrics directly
- how to fit SecretFlow's direct ML estimators
- how to compare SecretFlow's model APIs with scikit-learn
- why a model needs SPU, HEU, or a particular party layout
Reading order
- Read
references/analytics.mdfor the algorithm map and workflow choices. - Read the root troubleshooting page if the import or optional dependency path is broken.
- Use
scripts/analytics_smoke.pywhen you need a tiny import-only proof that the analytics surface is available.
Workflow
- Decide whether the user wants a data transform, a metric, or a model.
- Identify the required party/device layout before choosing the class or metric.
- For preprocessing and statistics, confirm the dataframe shape and the owning parties before you fit or evaluate anything.
- For ML classes, start with the direct Python constructor and only escalate to a component-based path if the user specifically needs export or CLI-driven execution.
Common decisions
- Use
StandardScalerfor federated tabular normalization. - Use
psi_evalfor the PSI-style score calculations already built into the direct API. - Use the
secretflow.ml.linearclasses for logistic-regression and GLM-style tasks. - Use
KMeans,GNB,GPC, orKNNClassiferwhen the task names a classical estimator family directly.
Bundled files
references/analytics.md— algorithm catalog, input expectations, and troubleshooting.scripts/analytics_smoke.py— small import and signature smoke helper.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).