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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21973517063b628d25875f8844af56a778f8330786c90828abd9b92dbe0b4d07
|
|
| MD5 |
1ce6297f34fdb322505c0f228cccacb0
|
|
| BLAKE2b-256 |
e2937cd3f9db95884cba99cc379beaf54c3ff46c27b925237d09092e697e2e71
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9533addd48875df90615b1aad7dbbc90d049e8d550d8fe8605014adbc78afeb8
|
|
| MD5 |
589e6ab3a654a7a08cde310338635ea6
|
|
| BLAKE2b-256 |
2bda5c1d9d89d61de8e2c3f52e025f7cb08112e53ae534f4401d191728370078
|