adult#

Module Contents#

Adult

Adult dataset from LIBSVM Data.

class Adult(root, train=True, transform=None, target_transform=None, download=False)#

Bases: torch.utils.data.Dataset

Adult dataset from LIBSVM Data.

Parameters:
  • root (str) – Root directory of raw dataset to download if download is set to True.

  • train (bool, optional) – If True, creates dataset from training set, otherwise creates from test set.

  • transform (callable, optional) – A function/transform that takes in an PIL image and returns a transformed version. Default as None.

  • target_transform (callable, optional) – A function/transform that takes in the target and transforms it. Default as None.

  • download (bool, optional) – If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.

url = 'https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/'#
train_file_name = 'a9a'#
test_file_name = 'a9a.t'#
num_classes = 2#
num_features = 123#
download()#
_local_file_existence()#
__getitem__(index)#
Parameters:

index (int) – Index

Returns:

(features, target) where target is index of the target class.

Return type:

tuple

__len__()#
extra_repr() str#