Dear Support team,
I am following the PDF version of the tutorial for SMILE wrappers, specifically for the Python language.
I tried to simulate a hybrid network (with both discrete and continuous variables).
I first predefined a network structure and then simulated a dataset. I tried to use the EM algorithm to do parameter learning for this network.
I found that the EM algorithm fails.
I know that the open-source package `pgmpy` does not support "parameter estimation" for mixed networks.
The official pgmpy package: https://pgmpy.org/
I asked ChatGPT, and it gave the following answer in Appendix A, which makes sense to me.
My question is, does SMILE support mixed network (network with both continuous and discrete variables) parameter learning?
I can only see in Tutorial 10, which is an example of a discrete network. There is no tutorial for a mixed network (a network with both continuous and discrete variables).
I included my preliminary experiment for mixed network parameter learning in this forum post: "Help needed for my example of simulating a hybrid model (with categorical and continuous model) and parameter learning".
Appendix A
You're right — the `pgmpy` package does **not currently support parameter estimation for hybrid (mixed) Bayesian networks**, where the model includes both **discrete (categorical)** and **continuous** variables. Here's why:
### 1. **Complexity of Conditional Distributions**
In mixed Bayesian networks, you can encounter conditional distributions like:
- A **continuous** variable conditioned on **discrete** parents (e.g., Gaussian Mixture Models)
- A **discrete** variable conditioned on **continuous** parents (non-trivial; not naturally supported by standard distributions)
`pgmpy`'s parameter estimation assumes:
- Discrete nodes use **Conditional Probability Tables (CPTs)**
- Continuous nodes use **Linear Gaussian distributions** (when supported)
These assumptions **don't scale well** to mixed cases, especially for:
- **Discrete children of continuous parents**, which require models like **logistic regressions** or **non-parametric approaches**
- **Conditional linear Gaussians** (CLG), which require intricate bookkeeping and constraints (e.g., continuous nodes can't be parents of discrete nodes in some formulations)
### 2. **Lack of General Hybrid Model Framework**
`pgmpy` is still developing hybrid support. It has basic infrastructure for:
- Discrete models (`BayesianModel`, `DiscreteFactor`)
- Continuous models (`LinearGaussianBayesianNetwork`, `ContinuousFactor`)
But **no integrated framework** yet exists to glue them together for mixed inference and learning. This also affects sampling and inference algorithms (like variable elimination, likelihood weighting), which need hybrid-aware implementations.
### 3. **Statistical and Computational Challenges**
Parameter estimation in hybrid models often requires:
- EM algorithms for latent structure
- Numerical integration for likelihood computation
- Specialized optimization for complex likelihoods
These are **non-trivial to implement** and are out of scope for many general-purpose libraries without substantial development.
---
### What You Can Do Instead
If you need mixed Bayesian networks, consider:
- **[Hugin](https://www.hugin.com/)** or **[Bayes Server](https://www.bayesserver.com/)** (commercial)
- **[bnlearn (R)](https://www.bnlearn.com/)** + manual modeling
- Using **approximate models**, e.g., discretize continuous variables or treat categorical as one-hot features in a continuous model
Let me know if you'd like help building a hybrid network manually or exploring alternative libraries.
Does SMILE support hybrid/mixed network (with both discrete and continuous variables) parameter learning/estimation?
-
- Posts: 15
- Joined: Tue Jun 10, 2025 3:51 pm
-
- Site Admin
- Posts: 1468
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Does SMILE support hybrid/mixed network (with both discrete and continuous variables) parameter learning/estimation?
I confirm that SMILE does not support parameter learning in hybrid networks.