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.

参数
  • 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)#
参数

index (int) – Index

返回

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

返回类型

tuple

__len__()#
extra_repr() str#