Package mklab.JGNN.adhoc
Class Dataset
java.lang.Object
mklab.JGNN.adhoc.Dataset
This class provides the backbone with which to define datasets. It provides
common operations for downloading and importing data.
- Author:
- Emmanouil Krasanakis
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclasses()Retrieves a converter that maps class names to label dimentions.protected voiddownloadIfNotExists(String file, String url) features()Retrieves the dataset's feature matrix.graph()Retrieves the dataset's graph.labels()Retrieves the dataset's sample labels in one-hot encoding.protected voidloadFeatures(String file) protected voidsamples()Retrieves a converter that maps samples to long identifiers that match them to rows offeatures(),labels(), andgraph()matrices.
-
Constructor Details
-
Dataset
public Dataset()
-
-
Method Details
-
downloadIfNotExists
-
loadFeatures
-
loadGraph
-
samples
Retrieves a converter that maps samples to long identifiers that match them to rows offeatures(),labels(), andgraph()matrices. For example, a list of all node ids can be obtained perdataset.samples().getIds()- Returns:
- A
IdConverter.
-
classes
Retrieves a converter that maps class names to label dimentions. For example, the prediction for one sample can be converted to its name perdataset.classes().get(prediction.argmax()).- Returns:
- An
IdConverter.
-
features
Retrieves the dataset's feature matrix.- Returns:
- A nodes x features
Matrix.
-
labels
Retrieves the dataset's sample labels in one-hot encoding.- Returns:
- A nodes x classes
Matrix.
-
graph
Retrieves the dataset's graph.- Returns:
- A
Matrixornullif the dataset is feature-only.
-