技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
learning-structure-and-parameters【数据与研究】Guide pgmpy causal discovery, CI tests, structure scores, expert knowledge, and parameter estimation from data.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is to learn graph structure or fit parameters from tabular data with pgmpy's canonical learning APIs. It covers causal/structure discovery, conditional-independence tests, structure scores, expert-knowledge constraints, and parameter estimators.
Own these workflows:
pgmpy.causal_discovery: PC, HillClimbSearch, GES, ChowLiu, TAN, SP, TOPIC, ANM, IGCI, ExpertKnowledge, and optional expert/LLM-in-the-loop estimators.pgmpy.ci_tests.pgmpy.structure_score.pgmpy.parameter_estimator: DiscreteMLE, DiscreteBayesianEstimator, DiscreteEM, and LinearGaussianMLE.Reroute these requests:
modeling-and-factors.data-io-and-evaluation.do-effect prediction -> causal-identification-and-effects.Prefer the newer canonical packages over legacy pgmpy.estimators examples:
pgmpy.causal_discovery.fit(data).causal_graph_ and adjacency_matrix_.model.fit(data, estimator=...) with an initialized estimator from pgmpy.parameter_estimator.Only use legacy pgmpy.estimators when the requested class has no canonical replacement or when reproducing an old API-specific workflow is explicitly required.
from pgmpy.causal_discovery import HillClimbSearch
from pgmpy.models import DiscreteBayesianNetwork
from pgmpy.parameter_estimator import DiscreteBayesianEstimator
est = HillClimbSearch(scoring_method="bic-d", return_type="dag", show_progress=False).fit(data)
model = DiscreteBayesianNetwork(est.causal_graph_.edges())
model.add_nodes_from(data.columns)
model.fit(data, estimator=DiscreteBayesianEstimator(prior_type="BDeu", equivalent_sample_size=5))
Keep show_progress=False in automated smoke tests and small examples unless the user specifically wants progress bars.