Skip to main content

All about missing data mechanisms: simulation, analysis, and visualization

Project description

MissMecha

MissMecha is a Python package for the systematic simulation, visualization, and evaluation of missing data mechanisms.
It provides a unified and principled interface to generate, inspect, and analyze missingness — supporting research, benchmarking, and education.

Documentation: https://echoid.github.io/MissMecha/


Highlights

  • All About Missing Mechanisms

    • Simulate MCAR, MAR, and MNAR with flexible configuration
    • Currently includes:
      • MCAR strategies
      • MAR strategies
      • MNAR strategies
      • Experimental support for categorical and time series missingness
  • Missingness Pattern Visualization

    • Visual tools to observe missing patterns
    • Helps diagnose potential mechanism types (e.g., MCAR vs. MAR)
  • Flexible Generator Interface

    • Column-wise or global simulation
    • fit / transform scikit-learn style API
    • Supports custom rates, dependencies, and label-based logic
  • Evaluation Toolkit

    • Metrics including MSE, MAE, RMSE, and our custom AvgERR
    • Built-in support for Little’s MCAR test
  • SimpleSmartImputer

    • Lightweight imputer that detects numerical vs. categorical columns
    • Applies mean/mode imputation with transparent diagnostics

Motivation

Working with missing data often involves disjointed code and inconsistent assumptions.

MissMecha solves this by consolidating diverse missingness simulation strategies — across MCAR, MAR, and MNAR — into one consistent, structured Python framework.

Whether you're exploring datasets, designing simulations, or teaching statistics —
MissMecha helps you simulate and analyze missingness with clarity and control.


⚡ Quick Preview

from missmecha import MissMechaGenerator
import numpy as np

X = np.random.rand(100, 5)

generator = MissMechaGenerator(
    mechanism="mar", mechanism_type=1, missing_rate=0.3
)
X_missing = generator.fit_transform(X)

Or configure per-column:

generator = MissMechaGenerator(
    info={
        0: {"mechanism": "mcar", "type": 1, "rate": 0.3},
        1: {"mechanism": "mnar", "type": 2, "rate": 0.4}
    }
)
X_missing = generator.fit_transform(X)

Documentation & Demos


Installation

pip install missmecha-py

Available on PyPI under the name missmecha-py.


Author

Developed by Youran Zhou, PhD Candidate @ Deakin University


License

MIT License


---

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

missmecha-py-0.1.1.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

missmecha_py-0.1.1-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

Details for the file missmecha-py-0.1.1.tar.gz.

File metadata

  • Download URL: missmecha-py-0.1.1.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for missmecha-py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1fb198e13d66f48808745af6562e1c30ac7b6e7071e1d5e4d4d747a8d374d9c9
MD5 b6a77f6d9f56f4ab87c05064d325a8bf
BLAKE2b-256 728d8e15ec7b6f18518edb752fdfa23a2b0f6ef65890c86de7d7c0ffea0dede2

See more details on using hashes here.

File details

Details for the file missmecha_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: missmecha_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for missmecha_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e53d0d7829e00c752db1be2ad4e09c32f35d2805754d125a276090ee2b8bbbf
MD5 3c3b3a719f8135a73fc9f7314d06c507
BLAKE2b-256 89d2c9e53fe17dca34d1eacae7a9157e8dc2a4dab37adbb61ef97232d46cd955

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page