Skip to main content

LightTAR

LightTAR replaces text or image columns in a pandas DataFrame with numeric features for a tabular model. By default, each selected column contributes up to 30 PCA features from the last encoder layer and 5 supervised features learned from the last and middle layers. The encoder stays frozen.

Install

Requires Python 3.10 or later. For the text example below, install lighttar[text].

Use case Command
Precomputed embeddings pip install lighttar
Text columns pip install "lighttar[text]"
Image columns pip install "lighttar[image]"
Text, images, and the LightGBM gate pip install "lighttar[all]"

To use the LightGBM gate with precomputed embeddings, run pip install "lighttar[gate]". You can also combine extras, for example pip install "lighttar[text,gate]".

Text

The first run downloads the text encoder (intfloat/e5-small-v2). Pass the text column names explicitly, or use LightTAR() to detect them. Other columns pass through unchanged.

import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import make_pipeline

from lighttar import LightTAR

train = pd.DataFrame({"review": ["Very helpful", "Hard to use", "Works well", "Broke immediately"]})
test = pd.DataFrame({"review": ["Easy to use", "Stopped working"]})

model = make_pipeline(LightTAR(columns=["review"]), LogisticRegression())
model.fit(train, [1, 0, 1, 0])
predictions = model.predict(test)

Images

For a column of image filenames, use this transformer in the same pipeline. The default DINOv3 model requires access on Hugging Face.

from lighttar import ImageLayerEncoder, LightTAR

features = LightTAR(columns=["photo"], encoder=ImageLayerEncoder(image_folder="images"))

Precomputed embeddings

Pass one array per split with shape (rows, layers, embedding_dim), with the last encoder layer first. A single layer can also be passed as (rows, embedding_dim).

from lighttar import LightTARProjection

projection = LightTARProjection()
Z_train = projection.fit_transform(H_train, y_train)
Z_test = projection.transform(H_test)

Optional gate

Use GatedLightTAR in place of LightTAR to choose between LightTAR and PCA using cross-validation. After fitting, gate_decision_ records the choice.

Metadata

Release files for lighttar 0.1.0

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

Source distribution (sdist)

Source distribution for lighttar 0.1.0
File Size Uploaded Provenance Actions
lighttar-0.1.0.tar.gz 46.2 kB With provenance Details for lighttar-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lighttar 0.1.0
File Interpreter ABI Platform Actions
lighttar-0.1.0-py3-none-any.whl Python 3 none any Details for lighttar-0.1.0-py3-none-any.whl

Total release size: 80.1 kB

Release files / lighttar-0.1.0.tar.gz

Download URL lighttar-0.1.0.tar.gz
Size 46.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b309bd8128b7c11db0bdefa157843339055698ca849bfc0c24438374964b6082
BLAKE2b-256 checksum
How to use checksums
32a86f6a5cff7f0f9b6cfef93ff43688189b464bfb40fcc145f13dcdfdb6dc14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Release files / lighttar-0.1.0-py3-none-any.whl

Download URL lighttar-0.1.0-py3-none-any.whl
Size 33.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b38cb21c29769dbe8c932c93c3aa031d1f1a09d50b8c5dc4d4fb20887b40aff
BLAKE2b-256 checksum
How to use checksums
5b90dab09cfb38e6a226cde6530051e7285ef3ddae2b710b1489d72e939751dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Security for lighttar 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lighttar-0.1.0.tar.gz

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 Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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