Regularized GLM models running on a GPU.
Project description
gpu_glm
A lightweight Python implementation of Generalized Linear Models (GLMs) that runs on a GPU.
This package provides:
- Gaussian, Bernoulli, Poisson, Gamma, and Inverse Gaussian models.
- Multiple link functions (identity, log, inverse, logit, probit, etc.)
- A Cupy-based implementation that falls back to Numpy.
- A sci-kit learn interface.
- L2 regularization.
Installation
To use the GPU, cupy must be installed with a GPU dependancies already working. If cupy is unavailable, numpy is used.
pip install gpu-glm
A conda package to handle GPU dependancies is under development.
Quick Example
Below fits a linear regression model.
import numpy as np
from gpu_glm import gaussian_glm
from sklearn.metrics import root_mean_squared_error
# Simulated data
X = np.column_stack([np.random.randn(100), np.ones(100)])
y = 2 * X[:, 0] + 3 + np.random.randn(100)
# Fit model
model = gaussian_glm()
model.fit(X, y)
print(f"coefficients: {model.coef()}")
y_hat = model.predict(X)
rmse = root_mean_squared_error(y, y_hat)
print(f"RMSE: {np.round(rmse, 3)}")
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 Distribution
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 gpu_glm-0.1.5.tar.gz.
File metadata
- Download URL: gpu_glm-0.1.5.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f57106c95f3d082e71b69c85af27d2c3260b774669d329cea72ac20c8c1caa8
|
|
| MD5 |
545a9651df19a6445705fafa834325a0
|
|
| BLAKE2b-256 |
8421fcc199abf78d66bbaba163e06aa1be33bd93f91f5c7a531956f5344915a7
|
Provenance
The following attestation bundles were made for gpu_glm-0.1.5.tar.gz:
Publisher:
publish_pypi.yml on gmcmacran/gpu_glm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpu_glm-0.1.5.tar.gz -
Subject digest:
0f57106c95f3d082e71b69c85af27d2c3260b774669d329cea72ac20c8c1caa8 - Sigstore transparency entry: 1240369745
- Sigstore integration time:
-
Permalink:
gmcmacran/gpu_glm@897a25ff64b2157a1e129021d974a685ee2c08c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gmcmacran
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@897a25ff64b2157a1e129021d974a685ee2c08c9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gpu_glm-0.1.5-py3-none-any.whl.
File metadata
- Download URL: gpu_glm-0.1.5-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0eec47659b671ad62737342aae67ac47972192f5fcc26336170e882c50166f46
|
|
| MD5 |
508f7273966cf2d5278b84d4cd881b0f
|
|
| BLAKE2b-256 |
323833ea99d268ae92dc734314da72cdd36ae5584acd74838ab660042162bf36
|
Provenance
The following attestation bundles were made for gpu_glm-0.1.5-py3-none-any.whl:
Publisher:
publish_pypi.yml on gmcmacran/gpu_glm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpu_glm-0.1.5-py3-none-any.whl -
Subject digest:
0eec47659b671ad62737342aae67ac47972192f5fcc26336170e882c50166f46 - Sigstore transparency entry: 1240369833
- Sigstore integration time:
-
Permalink:
gmcmacran/gpu_glm@897a25ff64b2157a1e129021d974a685ee2c08c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gmcmacran
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@897a25ff64b2157a1e129021d974a685ee2c08c9 -
Trigger Event:
workflow_dispatch
-
Statement type: