Structure Learning
Use this sub-skill when you want to learn a causal graph from data, tune NOTEARS/DYNOTEARS, or use the sklearn-style DAGClassifier and DAGRegressor wrappers.
Route here when
- The request names
from_pandas,from_numpy,from_pandas_dynamic,NOTEARS,DYNOTEARS,DAGClassifier,DAGRegressor, orNotearsMLP. - You need to convert numeric tabular data into a
StructureModel. - You need to learn a dynamic causal graph from lagged time-series data.
- You need a sklearn-style wrapper that returns feature importances or graph plots.
Route elsewhere when
- You already have the DAG and need CPDs, inference, intervention, metrics, or EM ->
../bayesian-networks/SKILL.md. - You need feature discretization before BN fitting ->
../discretization/SKILL.md. - You need synthetic DAGs or toy time-series data ->
../synthetic-data/SKILL.md.
Start fast
- Read
references/api-reference.mdfor the verified constructors and key parameters. - Read
references/workflows.mdfor the shortest tabular, dynamic, and sklearn wrapper recipes. - Run
../../scripts/smoke_structure_learning.pyafter install changes or API edits. - Read
references/troubleshooting.mdif the learner rejects your data or fails to converge.
Notes
use_gpu=Trueis only a preference for PyTorch NOTEARS; the implementation falls back to CPU when CUDA is unavailable.- The legacy
causalnex.structure.notearsfunctions do not takeuse_gpu; use the PyTorch module or wrappernotears_mlp_kwargsfor device controls. from_pandasandfrom_numpyexpect numeric input and reject NaN or infinity.StructureModelallows cycles, but the learned Bayesian-network path does not.
