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.3.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.3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabben-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 10a945b314a400dafb2152e571b93a187f4e6e95f2730f0aebf29c10b8cbc153
MD5 1c8b3e107e908b5c8ba4ada3070a75ce
BLAKE2b-256 3a7d857f8e9326d5733c08cc01a9ce7fec0e86fb28b9af35b04854aacb4b6f0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tabben-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 23805b65d2cd6f46d25ebcb1a1d85bd241e60771057226c12f4fb7a1f85b7e0f
MD5 07b64d46b6fcfaae97205314755de679
BLAKE2b-256 8ff8ebc48ac5819b2c9a0be1078066f1e8f6b80add1c457e8180933a6fb30cc2

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