# (conditional) Normalizing Flows for highly zero-inflated 1 dimensional data

**URL:** <https://discuss.bayesflow.org/t/conditional-normalizing-flows-for-highly-zero-inflated-1-dimensional-data/284>\
**Category:** General\
**Created:** [October 20, 2026, 8:44pm UTC](https://discuss.bayesflow.org/t/conditional-normalizing-flows-for-highly-zero-inflated-1-dimensional-data/284 "2026-10-20T20:44:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakubLiu](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JakubLiu](https://discuss.bayesflow.org/u/JakubLiu)\
**Post date:** [October 20, 2026, 8:44pm UTC](https://discuss.bayesflow.org/t/conditional-normalizing-flows-for-highly-zero-inflated-1-dimensional-data/284/1 "2026-10-20T20:44:43Z")

</div>

Hello!

I am new to Normalizing Flows and am trying to use a conditional Masked Autoregressive Flow, where the data that will be “normalized” is a 1 dimensional variable. More specifically it is a very highly zero inflated rate (~90% of values are 0.0). Do you have any suggestions how to address the problem of high zero inflation? Subsampling the zero counts is an option, but then a lot of data is lost and the zeros have a meaning. Thanks!

Jakub

---

<div class="post-metadata">

**Author:** ![paul.buerkner](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@paul.buerkner](https://discuss.bayesflow.org/u/paul.buerkner)\
**Post date:** [October 20, 2026, 9:32pm UTC](https://discuss.bayesflow.org/t/conditional-normalizing-flows-for-highly-zero-inflated-1-dimensional-data/284/2 "2026-10-20T21:32:38Z")

</div>

Welcome to the bayesflow forums! Can you share a histogram of your data perhaps? So we can get an idea of how your data looks like. Also what would you use as conditions (you put conditions in the title)?

---

<div class="post-metadata">

**Author:** ![KLDivergence](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.bayesflow.org/kldivergence/32/15_2.png) [@KLDivergence](https://discuss.bayesflow.org/u/KLDivergence)\
**Post date:** [October 20, 2026, 9:46pm UTC](https://discuss.bayesflow.org/t/conditional-normalizing-flows-for-highly-zero-inflated-1-dimensional-data/284/3 "2026-10-20T21:46:43Z")

</div>

Additionally, we don’t support MAFs in bayesflow. I would recommend going with a spline flow as a more performant option. Check out our [regression tutorial](https://bayesflow.org/v2.0.14/_examples/Linear_Regression_Starter.html), which may be of help.

---

<div class="post-metadata">

**Author:** ![JakubLiu](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JakubLiu](https://discuss.bayesflow.org/u/JakubLiu)\
**Post date:** [October 20, 2026, 10:17pm UTC](https://discuss.bayesflow.org/t/conditional-normalizing-flows-for-highly-zero-inflated-1-dimensional-data/284/4 "2026-10-20T22:17:16Z")

</div>

Thank you!

The distribution histogram looks like a heavily zero inflated beta distribution (I can share the histogram tomorrow). I conditon on manually handcrafted features extracted from genomic alignment data (each observation is a numeric vector of length 8). I have also tried to train a simple embedding MLP jointly with the normalizing flow and condition on the MLP embedding and not the raw data.

---

<div class="post-metadata">

**Author:** ![JakubLiu](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JakubLiu](https://discuss.bayesflow.org/u/JakubLiu)\
**Post date:** [October 20, 2026, 10:18pm UTC](https://discuss.bayesflow.org/t/conditional-normalizing-flows-for-highly-zero-inflated-1-dimensional-data/284/5 "2026-10-20T22:18:33Z")

</div>

Thank you, I will try that out! I initially chose MAF’s, because it was the most intuitive normalizing flow for my level of understanding.
