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

When testing/using locally (especially until the package is registered in PyPI), 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.1.tar.gz (7.9 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.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tabben-0.0.1.tar.gz
Algorithm Hash digest
SHA256 eebe0e2e7f3c501aff212dd81f267f78c83ff24598edf3f812e00de19990387b
MD5 5b10e13c07856bb295c00c8d24c71526
BLAKE2b-256 f674ababbe33d33f61a1ef469945cfd1ac3c718437b14c5bee1b7c57cfab1351

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tabben-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d49c096c99d63fa92023137dd53fb2f890bc6d77ff0b0c63b4e328f95350351c
MD5 befb9d61933c515281d86dc45fa2ad81
BLAKE2b-256 edd927c6f24ec4228acb59230cfce48440b6cf9dce114a87de349001cd947bac

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