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

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.2.tar.gz (9.5 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.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabben-0.0.2.tar.gz
  • Upload date:
  • Size: 9.5 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.2.tar.gz
Algorithm Hash digest
SHA256 1031415e8d0d28bf854c1a522f4601340b232c62cc50e883347e58aa3e6e9840
MD5 43faa814e334cb0e3c1a669791f54e23
BLAKE2b-256 02fa0b89fce1e62ba4be34f2093ef198cd9a6b73e0c3a5cb12d690de17abe3c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tabben-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f82c25562feaba31c7a6ef104a75afb1ed125a5ae29f86b53ee95a13a034b6d0
MD5 7923ce2a89ca46721fb27862e557ece1
BLAKE2b-256 20a67b0cbadf9d22da59db78961f76be39f830c94e96188a953a0d5298f95188

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