Skip to main content

hea: Linear Models with Python

hea v. (Cantonese)

  1. to kill time; to hang around
  2. to do something without putting much care or effort into it.
  3. to go through the motions; to give a carefree response; to beat around the bush; to treat someone lightly
  4. 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.

Metadata

Release files for hea 0.1.6

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

Source distribution (sdist)

Source distribution for hea 0.1.6
File Size Uploaded
hea-0.1.6.tar.gz 1.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for hea 0.1.6
File
hea-0.1.6-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
hea-0.1.6-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
hea-0.1.6-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
hea-0.1.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
hea-0.1.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
hea-0.1.6-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
hea-0.1.6-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 15.8 MB

Release files / hea-0.1.6.tar.gz

Download URL hea-0.1.6.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
88da9a1e209922016722182446406434963064f34f329757cf1593b3f58b23c7
BLAKE2b-256 checksum
How to use checksums
c522d6858228ae9bdf8e720d1d69fbfe8711752f3319b39842871d83b5daeed7
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 25, 2026.

Transparency log

Release files / hea-0.1.6-cp310-abi3-win_amd64.whl

Download URL hea-0.1.6-cp310-abi3-win_amd64.whl
Size 1.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ae8858e09c53c39033aaf3bc284bceddf723c99d8b42d3bc82f63e383f536f74
BLAKE2b-256 checksum
How to use checksums
3a2df33e7ca8c02117e8d93e8f3cccae17743ae50c817a28244431f7d0d5c038
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 25, 2026.

Transparency log

Release files / hea-0.1.6-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL hea-0.1.6-cp310-abi3-musllinux_1_2_x86_64.whl
Size 2.3 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
7901652aa62902686d4dbf096a252e8b106497daf7d06382e1a7f9fb4a9b57d8
BLAKE2b-256 checksum
How to use checksums
df94f65f35c68973e6d453cf480c669f8322fa7da776812a95f91e2283878aaf
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 25, 2026.

Transparency log

Release files / hea-0.1.6-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL hea-0.1.6-cp310-abi3-musllinux_1_2_aarch64.whl
Size 2.2 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
3fe481109237fb93a108f1de89cbb8ae35f48325a7e06cb2aa8eeeae2cde52aa
BLAKE2b-256 checksum
How to use checksums
b95eedbaf56a93fe06c39cd89ee27ea4ff8470eee3f3309a1c023c46bbdbafc8
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 25, 2026.

Transparency log

Release files / hea-0.1.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hea-0.1.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
fa5e7b3de1c89dbdafa0d62c748e916d427ce97cd64c7def49cb495078a41b25
BLAKE2b-256 checksum
How to use checksums
cfc5ebc0ab61ea5a73dc740a5c4fafe33eee58846b366bf3a9d916fba4e234ec
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 25, 2026.

Transparency log

Release files / hea-0.1.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hea-0.1.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.0 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
fe8eb2a9a4f240fd064ee71a49c3ff7435df74abfc17cc09416d20cac0eab405
BLAKE2b-256 checksum
How to use checksums
05789127197cdf399ff171f6457e02d3af81b98536be61cbb769078549a44199
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 25, 2026.

Transparency log

Release files / hea-0.1.6-cp310-abi3-macosx_11_0_arm64.whl

Download URL hea-0.1.6-cp310-abi3-macosx_11_0_arm64.whl
Size 2.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f50d762d7fe36cb247977fa31abf160e92a9890d02e3c55dc1b179124f5fab80
BLAKE2b-256 checksum
How to use checksums
ea80f4d73b0eae01b8ead2b6ae2a18c7825812997be900ae400c0e0a34345541
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 25, 2026.

Transparency log

Release files / hea-0.1.6-cp310-abi3-macosx_10_12_x86_64.whl

Download URL hea-0.1.6-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
31d077eb771abed0bf08d54ad1eeba7ab182dfcd31eb3a74e5e596edf0e2d9e1
BLAKE2b-256 checksum
How to use checksums
66c27b940181be9c9d970fc1dfd519ee98de7122ce17358e84d32edc706b0d5d
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

8 release files

0.1.10

8 release files

0.1.9

8 release files

0.1.8

8 release files

0.1.7

8 release files

This release

0.1.6 This release

8 release files

0.1.5

8 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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