Skip to main content

FLOWGEM

Generative sampling for missing data under MAR, via approximate Wasserstein gradient flows.

Coverage Python License

Tests

What is FLOWGEM?

FLOWGEM receives a dataset with missing values and generates a complete dataset sampled from the same distribution. It recovers the complete distribution of the data while preserving variances and correlations which keeps downstream analyses like means, quantiles, and correlations unbiased.

It targets data which is Missing at Random (MAR), including non-monotone MAR. It is nonparametric and makes no assumption about the shape of your data. Under the hood it uses approximate Wasserstein gradient flow which iteratively transports a particle ensemble towards target distribution.

Note: FLOWGEM currently supports continuous features only. Support for categorical and mixed type data is future work.

Installation

Install the released version from PyPI:

pip install flowgem

Or install the latest development version from GitHub:

pip install git+https://github.com/gkremling/FLOWGEM-package.git

Quick start

import numpy as np
from flowgem import FlowGEM

# Your data, with missing values marked as NaN
X = np.array([
    [1.2,    0.8,    3.1],
    [0.5,    np.nan, 2.7],
    [np.nan, 1.4,    2.9],
    [2.1,    0.3,    np.nan],
])

# Fit and generate a complete sample from the same distribution
model = FlowGEM(T=1000)
X_complete = model.fit(X).generate()

X_complete is a fully observed array (without missing value) which is drawn from estimated data distribution.

Features

  • Generative:- generate entire dataset from the full data distribution while preserving variances and correlations.
  • Handles non-monotone MAR:- works with arbitrary, scattered missingness patterns.
  • Nonparametric :- No assumption about the shape of your data.
  • scikit-learn-style API:- familiar fit / generate interface.
  • Tuning-lean:- sensible defaults; bandwidth is set from a single heuristic

Key parameters

Parameter What it does Default
T number of gradient-flow steps (more = better, slower) 1000
eta step size η (smaller = finer, slower) 0.01
sigma kernel bandwidth (None → chosen by heuristic) None

Documentation

Comprehensive and detailed documentation is available at Read the Docs.

Citation

The FLOWGEM method is based on:

Kremling, G., Näf, J., & Lederer, J. (2026). Generative Modeling under Non-Monotonic MAR Missingness via Approximate Wasserstein Gradient Flows.

While using the package in course of your research, please cite this paper:

@article{kremling2026flowgem,
  title   = {Generative Modeling under Non-Monotonic MAR Missingness
             via Approximate Wasserstein Gradient Flows},
  author  = {Kremling, Gitte and N\"af, Jeffrey and Lederer, Johannes},
  journal = {arXiv preprint arXiv:2604.04567},
  year    = {2026}
}

License

This project is licensed under the MIT License — see the LICENSE file.

Metadata

Release files for flowgem 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flowgem 0.1.0
File Size Uploaded Provenance Actions
flowgem-0.1.0.tar.gz 896.8 kB With provenance Details for flowgem-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flowgem 0.1.0
File Interpreter ABI Platform Actions
flowgem-0.1.0-py3-none-any.whl Python 3 none any Details for flowgem-0.1.0-py3-none-any.whl

Total release size: 908.6 kB

Release files / flowgem-0.1.0.tar.gz

Download URL flowgem-0.1.0.tar.gz
Size 896.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ab13730493d1df63847d4c33d1efd7534baeab8abfe669a58991f92c53effdb
BLAKE2b-256 checksum
How to use checksums
50e517903d026aee5aa47d821845263f52baa46371089c803f9c0741fa31b06d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / flowgem-0.1.0-py3-none-any.whl

Download URL flowgem-0.1.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9960a99fa1d388348274d0893f1caba52b9304a0ba3f27848b0268e5a01af3f
BLAKE2b-256 checksum
How to use checksums
dc766e0500e70e8d65d7f1be3a0fd0372055616962d4a7dc476845e16a3078a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for flowgem 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flowgem-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page