Skip to main content

Utilities shared between TabPFN codebases

Project description

TabPFN Common Utilities

A comprehensive utility package for TabPFN - the foundation model for tabular data.

Features

🔒 Privacy-First Telemetry System

  • Anonymous & Aggregated Data Collection: Implements safe, GDPR-compliant telemetry that respects user privacy
  • Configurable Analytics: Optional telemetry that can be disabled via environment variables
  • Usage Pattern Insights: Tracks TabPFN usage patterns to improve the model and user experience
  • Zero Personal Data: No personal information or sensitive data is collected or transmitted

💰 Cost Estimation

  • Resource Planning: Accurate estimation of computational costs and duration for TabPFN predictions
  • Cloud Pricing: Essential for resource planning in cloud-based TabPFN services
  • Task-Specific Calculations: Different cost models for classification vs regression tasks

📊 Data Processing Utilities

  • Regression Results: Comprehensive handling of prediction outputs with mean, median, mode, and quantiles
  • Data Serialization: Convert between pandas DataFrames, NumPy arrays, and CSV formats
  • Dataset Management: Load and preprocess standard ML datasets with proper train/test splits
  • Preprocessing Configuration: Extensive options for data transformation strategies

Installation

pip install tabpfn-common-utils

Or with uv:

uv add tabpfn-common-utils

Quick Start

Telemetry (Privacy-Compliant)

from tabpfn_common_utils.telemetry import ProductTelemetry

# Initialize telemetry service (anonymous, GDPR-compliant)
telemetry = ProductTelemetry()

# Track usage events (no personal data collected)
telemetry.capture(...)

# Telemetry can be disabled by setting environment variable
export TABPFN_DISABLE_TELEMETRY=1

Regression Results

from tabpfn_common_utils.regression_pred_result import RegressionPredictResult

# Handle regression prediction results
result = RegressionPredictResult({
    "mean": [1.2, 2.3, 3.4],
    "median": [1.1, 2.2, 3.3],
    "mode": [1.0, 2.0, 3.0],
    "quantile_0.25": [0.9, 1.9, 2.9],
    "quantile_0.75": [1.5, 2.5, 3.5]
})

# Convert to basic representation for serialization
basic_repr = RegressionPredictResult.to_basic_representation(result)

Data Utilities

from tabpfn_common_utils.utils import get_example_dataset, serialize_to_csv_formatted_bytes
import pandas as pd

# Load example dataset
X_train, X_test, y_train, y_test = get_example_dataset("iris")

# Serialize data to CSV bytes
csv_bytes = serialize_to_csv_formatted_bytes(X_train)

Privacy & Compliance

This package implements privacy-first telemetry that:

  • GDPR Compliant: No personal data collection
  • Anonymous Only: No user identification or tracking
  • Aggregated Data: Only statistical insights are collected
  • User Control: Can be completely disabled
  • Transparent: Open source code for full transparency

Telemetry data helps improve TabPFN but never compromises user privacy.

Development

Setup

# Install dependencies
uv sync

# Activate virtual environment
source .venv/bin/activate

# Run tests
uv run pytest

# Type checking
uv run pyright

# Code formatting
uv run ruff check --fix

Adding Dependencies

# Add runtime dependency
uv add <package_name>

# Add development dependency
uv add --group dev <package_name>

📝 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please ensure all code passes type checking and formatting requirements.

Links

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

tabpfn_common_utils-0.2.17.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabpfn_common_utils-0.2.17-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file tabpfn_common_utils-0.2.17.tar.gz.

File metadata

  • Download URL: tabpfn_common_utils-0.2.17.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for tabpfn_common_utils-0.2.17.tar.gz
Algorithm Hash digest
SHA256 a26e60e5fb38d0ec0d2e6343fb8912702dcb7f9aa7d169eb73250abab37d6763
MD5 180ec3a5c2dfac245919ca2de159d8e0
BLAKE2b-256 e488562859da0daa60a361759ed38db293c415d0cb5e911a6b7d58076c7b0cc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabpfn_common_utils-0.2.17.tar.gz:

Publisher: release.yml on PriorLabs/tabpfn_common_utils

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

File details

Details for the file tabpfn_common_utils-0.2.17-py3-none-any.whl.

File metadata

File hashes

Hashes for tabpfn_common_utils-0.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 36929b534b73c622302974694db271d9ee071624e024c9204210a35a6f623c7c
MD5 7bcc854498eebbf64eb81290e6bd42bf
BLAKE2b-256 5bf08b9fa9086f4029102ddf582f8f740133c75901914feb260d9564a0b15d8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabpfn_common_utils-0.2.17-py3-none-any.whl:

Publisher: release.yml on PriorLabs/tabpfn_common_utils

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