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.
Metadata
Release files for blockwise 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| blockwise-0.1.0.tar.gz | 1.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| blockwise-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.1 MB
Release files / blockwise-0.1.0.tar.gz
| Download URL | blockwise-0.1.0.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21973517063b628d25875f8844af56a778f8330786c90828abd9b92dbe0b4d07
|
|
BLAKE2b-256 checksum How to use checksums |
e2937cd3f9db95884cba99cc379beaf54c3ff46c27b925237d09092e697e2e71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / blockwise-0.1.0-py3-none-any.whl
| Download URL | blockwise-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9533addd48875df90615b1aad7dbbc90d049e8d550d8fe8605014adbc78afeb8
|
|
BLAKE2b-256 checksum How to use checksums |
2bda5c1d9d89d61de8e2c3f52e025f7cb08112e53ae534f4401d191728370078
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|