Catalog PyPI
PACKAGE EXPLORERView in registry

adult-dataset

PyPI

PyTorch dataset wrapper for the

adultcensusdatasetincomepytorch
Versions collected1
Direct dependencies8From release 3.0.0
Last observed20 Oct, 19:56 UTC

README

Version 3.0.0 documentation

adult-dataset

A PyTorch dataset wrapper for the Adult (Census Income) dataset. Adult is a popular dataset in machine learning fairness research.

This package provides the adult.Adult class: atorch.utils.data.Datasets loading and, optionally, downloading the Adult dataset. It can be used like the MNIST dataset in torchvision.

Beyond adult.Adult, this package also provides adult.AdultRaw, which works just as adult.Adult, but does not standardize the features in the dataset and does not apply one-hot encoding.

Installation

pip install adult-dataset

Basic Usage

from adult import Adult

# load (if necessary, download) the Adult training dataset 
train_set = Adult(root="datasets", download=True)
# load the test set
test_set = Adult(root="datasets", train=False, download=True)

inputs, target = train_set[0]  # retrieve the first sample of the training set

# iterate over the training set
for inputs, target in iter(train_set):
    ...  # Do something with a single sample

# use a PyTorch data loader
from torch.utils.data import DataLoader

loader = DataLoader(test_set, batch_size=32, shuffle=True)
for epoch in range(100):
    for inputs, targets in iter(loader):
        ...  # Do something with a batch of samples

Advanced Usage

Turn off status messages while downloading the dataset:

Adult(root=..., output_fn=None)

Use the logging module for logging status messages while downloading the dataset instead of placing the status messages on sys.stdout.

import logging

Adult(root=..., output_fn=logging.info)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
3.0.01 Feb 20248

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
cherrywoods/adult-dataset

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:56 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ae3512d27256ed2508a47a0c187070baea4054652ef8cbf9ed2af00094c38cd9