DatasetLoader¶
- class DatasetLoader[source]¶
Bases:
abc.ABC
A generic dataset.
Attributes Summary
Get the number of features for each context.
Get the number of features for each drug.
Get the number of contexts.
Get the number of drugs.
Get the number of labeled triples.
Methods Summary
Get the context feature set.
Get the drug feature set.
get_generator
(batch_size, context_features, …)Initialize a batch generator.
get_generators
(batch_size, context_features, …)Generate a pre-stratified pair of batch generators.
Get the labeled triples file from the storage.
Summarize the dataset.
Attributes Documentation
Methods Documentation
- get_generator(batch_size, context_features, drug_features, drug_molecules, labeled_triples=None)[source]¶
Initialize a batch generator.
- Parameters
batch_size (
int
) – Number of drug pairs per batch.context_features (
bool
) – Indicator whether the batch should include biological context features.drug_features (
bool
) – Indicator whether the batch should include drug features.drug_molecules (
bool
) – Indicator whether the batch should include drug moleculeslabeled_triples (
Optional
[LabeledTriples
]) – A labeled triples object used to generate batches. If none is given, will use all triples from the dataset.
- Return type
- Returns
A batch generator
- get_generators(batch_size, context_features, drug_features, drug_molecules, train_size=None, random_state=None)[source]¶
Generate a pre-stratified pair of batch generators.
- Return type