LIFTS
LIFTS is a package version of the latent factor imputation workflow developed in this repository. It keeps the original FBI implementation available internally, but exposes a cleaner estimator-style API for simulation experiments and downstream packaging.
The main entry point is LIFTSImputer, which follows the usual pattern:
model = LIFTSImputer(...)
model.fit(X_train, mask_train)
samples = model.impute_samples(X_test, mask_test)
Install
From this folder:
pip install -e .
For a fresh environment, install the listed runtime dependencies first if needed:
pip install -r requirements.txt
Release instructions for PyPI are in RELEASE.md.
Quickstart
from lifts import LIFTSImputer, make_case4_dataset
data = make_case4_dataset(
num_sample_train=200,
num_sample_test=50,
p=20,
d=5,
T=48,
obs_rate=0.5,
version="v1",
seed=42,
)
model = LIFTSImputer(
d=5,
total_loops=20,
batch_size=64,
n_samples=20,
lambda_selfmask=5.0,
lambda_enc=1.0,
enc_warmup=5,
seed=42,
)
model.fit(data["X_train"], data["mask_train"], verbose=True)
samples = model.impute_samples(data["X_test"], data["mask_test"], n_samples=20)
print(samples.shape) # (N, n_samples, p, T)
p and T can be passed to the constructor, or inferred from X_train during fit.
Data Format
LIFTS expects numpy arrays with shape (N, p, T):
X: observed time series values, with missing entries either zero-filled ornanmask: binary observation mask with1for observed and0for missing- returned imputation samples:
(N, n_samples, p, T)
The dataset helpers return both observed and complete arrays:
X_train,mask_train,X_train_fullX_test,mask_test,X_test_full
Key Parameters
lambda_selfmask: weight for the self-mask imputation loss. Default is5.0.lambda_enc: weight for synthetic encoder calibration. Default is0.0, which preserves the original training behavior.enc_warmup: number of training loops before encoder calibration starts. Default is50.enc_syn_batch: number of synthetic trajectories used by encoder calibration.Noneresolves tomin(4000, N)during training.enc_syn_mini_batch: chunk size for encoder calibration synthesis.Noneresolves tomin(batch_size, enc_syn_batch).
The training objective is:
L_total = L_forecast + lambda_selfmask * L_selfmask + lambda_enc * L_encoder
L_encoder is only added when lambda_enc > 0 and the warmup has completed.
Included Simulation Cases
make_case1_dataset(...): linear factor state-space simulationmake_case3_dataset(...): nonlinear simulation variantmake_case4_dataset(..., version="v1"): benchmark-compatible Case 4 used by the packaged examplesmake_case4_dataset(..., version="v2"): current local Case 4 generator
Examples
Scripts:
examples/scripts/case1_minimal.pyexamples/scripts/case3_minimal.pyexamples/scripts/case4_minimal.py
Notebooks:
examples/notebooks/case1_lifts.ipynbexamples/notebooks/case4_lifts.ipynb
The notebooks include plot_probabilistic_imputation, exported at the package root:
from lifts import plot_probabilistic_imputation
Backward Compatibility
The lower-level FBIImputer and get_fbi_config APIs remain importable:
from lifts import FBIImputer, get_fbi_config
For new code, prefer LIFTSImputer because it exposes the common training controls directly in the constructor.
Release files for lifts 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 | |
|---|---|---|---|
| lifts-0.1.0.tar.gz | 100.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lifts-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 208.7 kB
Release files / lifts-0.1.0.tar.gz
| Download URL | lifts-0.1.0.tar.gz |
|---|---|
| Size | 100.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d59e7774a68f669a986f942497ae6667b83739dcdf9b89676021c0c97f1c71c
|
|
BLAKE2b-256 checksum How to use checksums |
4ab044448b17d336a86cd56b3a10ce231f8d4a2a2b30fc86d31d954669ea7cc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 30, 2026.
Transparency logRelease files / lifts-0.1.0-py3-none-any.whl
| Download URL | lifts-0.1.0-py3-none-any.whl |
|---|---|
| Size | 108.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
77a5689f47700622f957a192207dd5210529ae054568a6f11a0309319cfe874a
|
|
BLAKE2b-256 checksum How to use checksums |
117a302030f975b82471c41d37bb0d25a3f803390ab3ee1ebcdaacd4916bce0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 30, 2026.
Transparency log