MCPcopy Create free account
hub / github.com/TrustAIResearch/MLHospital / cut_dataset

Function cut_dataset

mlh/data_preprocessing/dataset_preprocessing.py:113–120  ·  view source on GitHub ↗
(dataset, num)

Source from the content-addressed store, hash-verified

111
112
113def cut_dataset(dataset, num):
114
115 length = len(dataset)
116
117 torch.manual_seed(0)
118 selected_dataset, _ = torch.utils.data.random_split(
119 dataset, [num, length - num])
120 return selected_dataset
121
122
123def count_dataset_for_class(num_class, dataset):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected