Skip to main content

Tensor Separation Learning: interpretable regression via sums of rank-1 separable components.

Project description

tensorsl

Tensor Separation Learning (TSL) — a glass-box regression model. A fitted model is a sum of stages, where each stage is the ordered difference of two non-negative rank-1 products of univariate functions. This keeps the model inspectable while still capturing interactions between features.

tensorsl is the Python package (imported as tsl_py): a fit/predict estimator that slots into typical ML pipelines, backed by a Rust core.

Install

pip install tensorsl

The package builds from source on install for now, so you need a Rust toolchain and a BLAS library (e.g. OpenBLAS) available. Prebuilt wheels are planned.

Usage

import numpy as np
from tsl_py import TSLRegressor

rng = np.random.default_rng(0)
X = rng.normal(size=(500, 5))
y = X[:, 0] * X[:, 1]

model = TSLRegressor().fit(X, y)
preds = model.predict(X)

The fitted model also exposes per-feature partial dependence and feature importances for interpretation.

Links

License

MIT

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

tensorsl-0.1.0.tar.gz (46.2 MB view details)

Uploaded Source

File details

Details for the file tensorsl-0.1.0.tar.gz.

File metadata

  • Download URL: tensorsl-0.1.0.tar.gz
  • Upload date:
  • Size: 46.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tensorsl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6737979e6b08008b3c9df22ae939e8fa6c366570adaa6f50c5b163a3ad0b9310
MD5 3b4b07bc8f5998f369030c5537911048
BLAKE2b-256 491b22692788b4971c5bb00ed4480d1767c7f5400fddaf2b763d8166180fd9c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for tensorsl-0.1.0.tar.gz:

Publisher: release.yml on jyliuu/TSL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page