rcv1#

Module Contents#

RCV1

RCV1 binary dataset from LIBSVM Data.

class RCV1(root, train=True, train_ratio=0.75, transform=None, target_transform=None, download=False, generate=False, seed=None)#

Bases: torch.utils.data.Dataset

RCV1 binary 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.

num_classes = 2#
num_features = 47236#
url = 'https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/rcv1_train.binary.bz2'#
source_file_name = 'rcv1_train.binary.bz2'#
download()#
generate()#
_local_npy_existence()#
_local_source_file_existence()#
__getitem__(index)#
Parameters:

index (int) – Index

Returns:

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

Return type:

tuple

__len__()#