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

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.8
File Size Uploaded
hea-0.1.8.tar.gz 1.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for hea 0.1.8
File
hea-0.1.8-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
hea-0.1.8-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
hea-0.1.8-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
hea-0.1.8-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.8-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
hea-0.1.8-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
hea-0.1.8-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 19.4 MB

Release files / hea-0.1.8.tar.gz

Download URL hea-0.1.8.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
c1832bb33fb45ce15097b9a7c63877a5fb01098abf1df8260a44ae4a25c60eb0
BLAKE2b-256 checksum
How to use checksums
e8c580b665e684de6f3f7a2145faa09a61fa7152db40482af2c28ee0ab6e834d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

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

Download URL hea-0.1.8-cp310-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e2dc7b9f73f6cdb5cd5834bf9c9e8004f88096557a2dd39220626147bcacf36e
BLAKE2b-256 checksum
How to use checksums
fc078255d1f2adc5fd47669a6813bca533ddfbb1fd1a5c2b078642d6e1455097
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

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

Download URL hea-0.1.8-cp310-abi3-musllinux_1_2_x86_64.whl
Size 2.7 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
b407a41b1ee91b8f6eaebae0734cc107c1d9921766742285d4e5e8a564ada05a
BLAKE2b-256 checksum
How to use checksums
7062f2e4e9df3a2f8162ce82235438931df9b961ec78e720a1c981ecc0cdd144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

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

Download URL hea-0.1.8-cp310-abi3-musllinux_1_2_aarch64.whl
Size 2.7 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
f29a5dbf1e83a8ade587a92815c4bb28d10e9849d0b24d2d5c4dfb0fa5e22411
BLAKE2b-256 checksum
How to use checksums
e147de7650689afaaaafe18b12e783f70b2b8be852231369175f96d396ab2ac1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

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

Download URL hea-0.1.8-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
9e8052dfbfa8ba5d5705f0f0b6ed6f206dda7117e17ba933b8035e6075a1afcb
BLAKE2b-256 checksum
How to use checksums
ffba7c570f388a6a784631ae24b80623bfcfb613f1357e56235247c39ca533db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

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

Download URL hea-0.1.8-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.5 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
268cd47208ad69062b46b8342ae630f8d56361aaa2c5161020c7d1431a80a4c1
BLAKE2b-256 checksum
How to use checksums
a4248034a5505455ccde341039de618d6bae63a95af02f3c183daadab9e67c0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

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

Download URL hea-0.1.8-cp310-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3ca96415bc9e139d3eac97b6f23d229a051ed1bca8aad2829911d65e368d3a92
BLAKE2b-256 checksum
How to use checksums
8a53845e3d81f2d85c07baeddad320fefcb0e0496bfb89b2f9aab1c483a5c767
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

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

Download URL hea-0.1.8-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.5 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1f871bcc152837aa68aaf0ef0bac65f581e1c98290c173c271d11d94e70bf270
BLAKE2b-256 checksum
How to use checksums
fa2de6bfd4a6c4ce0416f5f3fe92793491f2f4c12b75f128a4abd283c6de0f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 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

This release

0.1.8 This release

8 release files

0.1.7

8 release files

0.1.6

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