Skip to main content

A package for working with datasets from the open benchmark for tabular data

Project description

A Python package for the Open Benchmark for Tabular Data

Package Unit Tests

Set Up

For the most recent stable release, you can install the tabben package from PyPI:

pip3 install tabben

If testing/using locally from source, you can install the tabben package locally; from this directory,

pip3 install -e .

Documentation

There are PyTorch Dataset objects available from tabben.datasets. For example,

from tabben.datasets import OpenTabularDataset
from torch.utils.data import DataLoader

# load the arcene dataset (default is train split) and
# save the data to the current directory 
ds = OpenTabularDataset('./', 'arcene')
for inputs, labels in DataLoader(ds, batch_size=4):
    # do stuff with inputs and labels

All the currently implemented datasets are accessible this way, except for the CIFAR10 dataset. Since it's a standard computer vision dataset, we just wrap the CIFAR10 Dataset from torchvision and convert the images into a vector.

from tabben.datasets import TabularCIFAR10Dataset
from torch.utils.data import DataLoader

cifar_ds = TabularCIFAR10Dataset('./')
for inputs, labels in DataLoader(cifar_ds, batch_size=4):
    # do something with inputs and labels

The non-image tabular datasets can also be accessed as either numpy arrays or pandas dataframes:

from tabben.datasets import OpenTabularDataset

# load the training set as numpy arrays (these are *not* copies) 
ds = OpenTabularDataset('./', 'covertype')  # defaults are numpy arrays of the training set
train_X, train_y = ds.numpy()

# load as a single pandas dataframe
df = ds.dataframe()

ds_inputs = df[ds.input_attributes]
ds_outputs = df[ds.output_attributes]

For a list of all the currently implemented datasets in the benchmark (except for CIFAR10), there's the function:

from tabben.datasets import list_datasets

print(list_datasets())

Testing

After installing pytest, all the tests can be run by just running

pytest

from a parent directory.

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

tabben-0.0.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

tabben-0.0.4-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file tabben-0.0.4.tar.gz.

File metadata

  • Download URL: tabben-0.0.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for tabben-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1d4eeff185ac0c8f6db0bcb4e4e946c26da0a5f277af911092e6e2edd7b5cd4e
MD5 9cf50e62de8784bd4a475bfe6e683119
BLAKE2b-256 e05a4010e7ed901c67ad486673544f08cfb20137c1639a67a89c6f2d7ab31343

See more details on using hashes here.

File details

Details for the file tabben-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: tabben-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for tabben-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 db9457453876a003053d9d15d5eab7ce3ea0aac28f6486868fd0e3663a4a3494
MD5 7ec6c22c4d8e49526cc6d23e6f249ec1
BLAKE2b-256 bc6971fa1d0a9d8f3e467f7c071ac7ba3f8e1c6a427cb67b08e84256ac88a0e1

See more details on using hashes here.

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