Skip to main content

logit-stream

Logit models for data that do not fit in memory: binary, multinomial, ordered, conditional, nested and mixed logit, fitted by Newton's method with the data streamed off disk, from pyfixest-style formulas, with absorbed fixed effects or random intercepts.

from logit_stream import mlogit_stream

fit = mlogit_stream(
    "race ~ C(agecat) + female + C(inccat) + C(cit) | puma",
    "acs/*.parquet",               # a Parquet path or glob, never fully loaded
    vcov={"CRV1": "puma"},
)
fit.summary()
fit.predict("people/*.parquet").sink_parquet("imputed.parquet")   # lazily
logit_stream, probit_stream binary logit and probit with any number of fixed effects (hdfe-stream's feglm_stream)
mlogit_stream multinomial logit (any number of fixed effects; several through a Poisson regression)
ologit_stream, oprobit_stream ordered logit and probit
clogit_stream conditional (McFadden) logit on long-format choice data
cfelogit_stream Chamberlain's conditional fixed-effects logit for panels
mixlogit_stream, nlogit_stream mixed and nested logit (prototypes)

Newton's method for a logit needs the data only through sums over rows -- the log-likelihood, its gradient and the information matrix -- so each step is one read of the data, block by block, and one dense solve; the likelihoods are concave, so a handful of steps suffice. Memory grows with the number of coefficients, not of rows. The multinomial and ordered logit absorb one fixed effect exactly, by eliminating its per-level blocks of the information matrix in every step.

Results share hdfe-stream's reporting: summary(), tidy(), summary_dict(), summary_json(), confint(), wald_test(), with_vcov(), etable(), and lazy predict(), resid(), sample() and fixef() frames. Estimates and standard errors match statsmodels and scikit-learn (see tests/).

Documentation: https://leetucker.github.io/logit-stream/ (build locally with pip install -e ".[docs]" and sphinx-build -b html docs docs/_build/html). examples/ has a runnable script for each page of its guide, on simulated data.

Install

pip install logit-stream

Python 3.10 or later. On Python 3.15, pyfixest 0.60 (which hdfe-stream's formula extra brings in) has no wheels yet: it builds from source with a Rust toolchain and PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 set; everything else installs from wheels.

Benchmarks

benchmarks/ compares logit-stream with scikit-learn, statsmodels, mord and R's glm, fixest, nnet, MASS and ordinal on American Community Survey microdata (10,000 to 12.9 million adults); with xlogit, pylogit, statsmodels, jaxlogit, Biogeme and R's mlogit and logitr on the Swissmetro choice survey, resampled to 10 million choice sets; on short panels with statsmodels and R's survival, fixest and alpaca; and on a GPU. See benchmarks/README.md and the documentation's benchmark pages.

License

MIT.

Metadata

Release files for logit-stream 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logit-stream 0.1.0
File Size Uploaded Provenance Actions
logit_stream-0.1.0.tar.gz 167.7 kB With provenance Details for logit_stream-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for logit-stream 0.1.0
File Interpreter ABI Platform Actions
logit_stream-0.1.0-py3-none-any.whl Python 3 none any Details for logit_stream-0.1.0-py3-none-any.whl

Total release size: 311.3 kB

Release files / logit_stream-0.1.0.tar.gz

Download URL logit_stream-0.1.0.tar.gz
Size 167.7 kB
Tags Source
SHA-256 checksum
How to use checksums
41f9f66f52558b1a51a0fd691261b80def360c245ba14a49cebd3ca797c47881
BLAKE2b-256 checksum
How to use checksums
a066dddc215862e30dacff9016d82cadc79c918c0c80979130edf319a654cb85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 29, 2026.

Transparency log

Release files / logit_stream-0.1.0-py3-none-any.whl

Download URL logit_stream-0.1.0-py3-none-any.whl
Size 143.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f9909b9e39f089fbd31efb86a49a450e7b054f7fe196e0237eec2edfdc745ff
BLAKE2b-256 checksum
How to use checksums
f4b99c42dac27bb7ccf8d542bde79e68bd283ddc04b5c14fd0076f5fee96d567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 29, 2026.

Transparency log

Security for logit-stream 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for logit_stream-0.1.0.tar.gz

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 Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page