bn-fit-modify
Installation
SKILL.md
Bayesian Network Fitting and Modification
Overview
This skill provides guidance for tasks involving Bayesian Network structure recovery, parameter estimation, causal intervention, and sampling. It covers common pitfalls when using libraries like pgmpy for Linear Gaussian Bayesian Networks and other BN types.
Workflow
Phase 1: Structure Learning
When recovering a DAG structure from observational data:
- Explore the data first - Understand variable types, distributions, and potential relationships before applying algorithms
- Choose appropriate algorithms based on data size:
- For large datasets, constraint-based methods (PC algorithm) may cause memory issues
- Score-based methods (HillClimbSearch) can also be memory-intensive
- Consider correlation-based greedy approaches for very large datasets
- Apply domain constraints - If constraints are given (e.g., "variable U has no parents", "exactly N edges"), incorporate them into the search
- Handle ambiguous edges - When multiple edges have similar scores, follow any specified ordering rules (e.g., alphabetical) for deterministic results