Linear Models with Python
Project description
hea: Linear Models with Python
hea v. (Cantonese)
- to kill time; to hang around
- to do something without putting much care or effort into it.
- to go through the motions; to give a carefree response; to beat around the bush; to treat someone lightly
- to place things casually; to disperse (with an outward motion) (from wikitionary)
This project started as a laid-back exercise of implementing R's lmin Python many years ago. It was called lmpy at the time. I wanted to add lme and gam too, but didn't manage to go very far, mostly because the Python ecosystem back then still lacked general supports for generating the needed design matrices to fit such models. I come back to it from time to time, check community progress, tinker with it a bit myself, and slowly, try to do it with many generations of LLMs as they came along. It's kind of becoming my private benchmark for LLMs, and see at which point they can crack code porting from R to Python without too much hand holding. Until recently, they still couldn't. But since Claude Code with Opus 4.6, things started to change.
BTW, the name lmpy is blocked on PyPI due to the name is "too similar to some existing projects", so I asked Claude to brainstorm some other names and one of them is "hea, v., to measure" in Hawaiian, which is likely a hallucination. But I like it a lot, as it means something completely different in Cantonese and fit the vibe of this project nicely. :)
Install
pip install hea
for sparse matrix speed-up in lme, you might want to use scikit-sparse, but you need to install some system deps first:
# mac
brew install suite-sparse
# debian
sudo apt-get install libsuitesparse-dev
then
pip install "hea[fast]"
Usage
from hea import data
from hea.models import lm
gala = data('gala', package='faraway')
m = lm('Species ~ Area + Adjacent + Elevation + Nearest + Scruz', gala)
m.summary()
See more examples.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 hea-0.1.5.tar.gz.
File metadata
- Download URL: hea-0.1.5.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71fb86bbca546ae597441d4edb284bcba00cb60325dd75496746326cae7d2c80
|
|
| MD5 |
85e1d8656052379c81036e61d25bee4e
|
|
| BLAKE2b-256 |
b61a6b397aa3a990f22b9b24650bc8ef361c264e4f88c7e8b4c281016d1f281d
|
File details
Details for the file hea-0.1.5-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: hea-0.1.5-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3af2455c3a202bb41da051e75658d5fab20b97a62ad1fc55bacc7df7002f3d0b
|
|
| MD5 |
f99828148889b31115d3cff152d954bc
|
|
| BLAKE2b-256 |
c6910bd467bbf13400f1cffe56bd59e4731b93889ecf880453fa6426c496996f
|
File details
Details for the file hea-0.1.5-cp310-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: hea-0.1.5-cp310-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.10+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00ef9562481509d5f81cb1428c3128990f70474b9c21d630947215805bacdcea
|
|
| MD5 |
2df9774c21df66aae1ef419423175eb7
|
|
| BLAKE2b-256 |
073f9624ad55b41dddfef40a850272752e763536f4922be8f71d6a6a46c57078
|
File details
Details for the file hea-0.1.5-cp310-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: hea-0.1.5-cp310-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee67bc2268903c39b10a57285bc0bbbb33b44b0e7a7891628ed17323496ada18
|
|
| MD5 |
ad8c4c1d69d85d17ed0db253cda85597
|
|
| BLAKE2b-256 |
23c700cffed0ed28b7859b1d2ac294ae93816f529924c8b27df08d858a22ab6a
|
File details
Details for the file hea-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hea-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
730c74e9943e9f6bad0e068ccdc80669bb553e52767c53fcd8d5b64ad330517a
|
|
| MD5 |
d670f0e3fee96922a173e50edd7686db
|
|
| BLAKE2b-256 |
fe97ce5aaba50125b989bd049ff23d97c7930abec0496881c67b83d04d4566a0
|
File details
Details for the file hea-0.1.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: hea-0.1.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d49bbb82a21b03d755735e6263b2f87818dcc08b20d9ddd1a4aee764969ecb19
|
|
| MD5 |
49defcf033a820b7cbb246156f9ac1bf
|
|
| BLAKE2b-256 |
c5e3700119b575aec37cfcf1122781cff0656623c3a86d31ed5a114bb838bb98
|
File details
Details for the file hea-0.1.5-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: hea-0.1.5-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfd6c03d1983d6274be637743d7d434aa0b58f6969a9f8b1e6f9c275fde65afd
|
|
| MD5 |
955266634c3ee19580d8b59bc1ecfeb9
|
|
| BLAKE2b-256 |
e6cc104bab98969b0154ae9d27a65acb39c4441d5d9d68def4961a270c1e5ef9
|
File details
Details for the file hea-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: hea-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c37dff8fd5b87ae45290c65d8c8f3a146b399a670ce0265ea5874aa0b6b6e6d
|
|
| MD5 |
a0f728171a8208cf48558d4a2e8ae22a
|
|
| BLAKE2b-256 |
33d936de5b09017df0ae6b5e9a71189e6628de6cdca715d2876ce845dc67148a
|