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
-
Method Summary
Modifier and TypeMethodDescriptionclasses()
Retrieves a converter that maps class names to label dimentions.protected void
downloadIfNotExists
(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 void
loadFeatures
(String file) protected void
samples()
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
Matrix
ornull
if the dataset is feature-only.
-