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 (Latest)

Set Up

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

pip3 install tabben --upgrade

If testing/using locally from source, you can install the tabben package locally; first clone this repository locally, and then install 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
    pass

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
    pass

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabben-0.0.6.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 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.6.tar.gz
Algorithm Hash digest
SHA256 fe133d8ff0f59408db9d8596e0918f36613cedf1c9f7c421aa204af00a9ed169
MD5 8d0747679b53216999f6f32e0ba2af29
BLAKE2b-256 2122ba152f8c3b30536426244cffb21f87100f5098daffa094d512a343390fc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tabben-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf8bc977cd5dc0bfc46ab75931fe60ff7a80163c53914e47dccf0d86688b40d
MD5 2e34c9613c6b59efc29bea1b9d933a4d
BLAKE2b-256 96c4be6c4fcd095fe66f81ac25e0449fdbeb1a57e55be89743ca0c7346a33d81

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