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.

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.3.1

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.3.1
File Size Uploaded Provenance Actions
logit_stream-0.3.1.tar.gz 184.7 kB With provenance Details for logit_stream-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 337.8 kB

Release files / logit_stream-0.3.1.tar.gz

Download URL logit_stream-0.3.1.tar.gz
Size 184.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1b1408f2346147ed0b1cf25976c7ff2b76bf14e42c15b4ee19aebe50b5c6dd43
BLAKE2b-256 checksum
How to use checksums
a89910c88e5b7d4274f110902f74b97f95ba7e3a00066bc76088a2bb82aa5a2a
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 Nov 10, 2026.

Transparency log

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

Download URL logit_stream-0.3.1-py3-none-any.whl
Size 153.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17a82b6453c43aeedbf630f3e344269c3157b8926d39e1de889061d27015ebce
BLAKE2b-256 checksum
How to use checksums
7ef0b4bc623e580e5501c723f5d79838439b5ae411e4472ccf6a01b900473657
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 Nov 10, 2026.

Transparency log

Security for logit-stream 0.3.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for logit_stream-0.3.1.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 Nov 10, 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.

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