界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

frequent-patterns

frequent-patterns

【数据与研究】Mine frequent itemsets and association rules from transaction data with mlxtend frequent_patterns.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: frequent-patterns description: "Mine frequent itemsets and association rules from transaction data with mlxtend frequent_patterns." disable-model-invocation: true metadata: disco-role: operating license: NOASSERTION

Frequent Patterns

Use this sub-skill when the task involves market-basket or transaction mining with mlxtend.frequent_patterns: frequent itemsets, maximal itemsets, association rules, support/confidence/lift-style metrics, null-aware FP mining, sparse one-hot data, or threshold diagnosis.

Route first

  • Start with references/data-formats.md when the input is raw transactions, one-hot pandas data, sparse data, nullable data, or previously mined itemsets/rules.
  • Use references/api-reference.md for verified function signatures, return columns, algorithm differences, and metric names.
  • Use references/workflows.md for transaction-to-rules recipes, algorithm selection, rule filtering, null handling, and support/threshold tuning.
  • Use references/troubleshooting.md for invalid inputs, missing columns, empty results, metric errors, nullable/sparse warnings, and memory growth.
  • Run scripts/frequent_patterns_smoke.py to verify that the installed package can encode transactions, mine itemsets, and generate rules on a tiny deterministic dataset.

Boundaries

  • Prefer TransactionEncoder only as the upstream route from list-of-lists transactions into a one-hot pandas DataFrame. For broader preprocessing and transformer behavior, route to ../feature-workflows/SKILL.md.
  • Do not handle plotting or visualization here. Route rule plots, heatmaps, and Matplotlib utilities to ../plotting-and-utilities/SKILL.md.
  • Keep downstream mining code package-based; the runtime workflow must use only installed package APIs and bundled skill files.

Fast decision map

GoalPrimary APINotes
All frequent itemsets, classic candidate searchaprioriSupports low_memory and n_jobs; no nullable-NaN mode.
All frequent itemsets, usually faster on sparse/large basketsfpgrowthFP-tree based; supports null_values=True.
Only maximal frequent itemsetsfpmaxCompact output; not a full subset lattice for normal rule metrics.
All frequent itemsets via H-MinehmineAlternative frequent-itemset miner; no nullable-NaN mode.
Rules from complete frequent itemsetsassociation_rulesRequires support and itemsets; use full itemset output unless support_only=True.
Raw transactions to one-hot DataFrameTransactionEncoderCreate pd.DataFrame(te.fit_transform(transactions), columns=te.columns_).
我的收藏