Skip to main content

Blockwise Reduced Modeling (BRM) for tabular data with blockwise missing patterns

Project description

blockwise

Blockwise Reduced Modeling (BRM) for tabular data with blockwise missing patterns — a scikit-learn-compatible estimator.

Install

pip install blockwise

Quickstart

import pandas as pd
from sklearn.ensemble import GradientBoostingRegressor
from blockwise import BRM, simulate_blockwise_missing, datasets

bike = datasets.load_bike()
bike_miss = simulate_blockwise_missing(
    bike,
    blocks=[["windspeed", "hum", "weekday"],
            ["hr", "temp", "weathersit"]],
    prop_missing=0.30,
    noise=0.05,
)

X = bike_miss.drop(columns=["cnt"])
y = bike_miss["cnt"]

brm = BRM(estimator=GradientBoostingRegressor()).fit(X, y)
y_hat = brm.predict(X)

BRM is learner-agnostic: pass any estimator with fit(X, y) / predict(X) (and optionally predict_proba(X) for classification). Each block's model is a fresh clone of estimator.

What BRM does

BRM partitions the training data into overlapping subsets based on per-row feature-missing patterns, pre-trains one model per subset on only the observed columns of that subset, and at prediction time routes each test row to the subset model whose missingness pattern most closely matches.

See notebooks/ for worked examples on the bike (regression), adult (binary classification), and house (regression) datasets.

Citation

If you use this package, please cite the paper that introduced the method:

Srinivasan, K., Currim, F., and Ram, S. (2025). A Reduced Modeling Approach for Making Predictions With Incomplete Data Having Blockwise Missing Patterns. INFORMS Journal on Data Science.

A machine-readable CITATION.cff is included at the repo root.

License

GPL-3.0-or-later. See 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

blockwise-0.1.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

blockwise-0.1.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file blockwise-0.1.0.tar.gz.

File metadata

  • Download URL: blockwise-0.1.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for blockwise-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21973517063b628d25875f8844af56a778f8330786c90828abd9b92dbe0b4d07
MD5 1ce6297f34fdb322505c0f228cccacb0
BLAKE2b-256 e2937cd3f9db95884cba99cc379beaf54c3ff46c27b925237d09092e697e2e71

See more details on using hashes here.

File details

Details for the file blockwise-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: blockwise-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for blockwise-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9533addd48875df90615b1aad7dbbc90d049e8d550d8fe8605014adbc78afeb8
MD5 589e6ab3a654a7a08cde310338635ea6
BLAKE2b-256 2bda5c1d9d89d61de8e2c3f52e025f7cb08112e53ae534f4401d191728370078

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