Class Dataset

java.lang.Object
mklab.JGNN.adhoc.Dataset
Direct Known Subclasses:
Citeseer, Cora, Pubmed

public class Dataset extends Object
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 Details

    • Dataset

      public Dataset()
  • Method Details

    • downloadIfNotExists

      protected void downloadIfNotExists(String file, String url)
    • loadFeatures

      protected void loadFeatures(String file)
    • loadGraph

      protected void loadGraph(String file)
    • samples

      public IdConverter samples()
      Retrieves a converter that maps samples to long identifiers that match them to rows of features(), labels(), and graph() matrices. For example, a list of all node ids can be obtained per dataset.samples().getIds()
      Returns:
      A IdConverter.
    • classes

      public 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 per dataset.classes().get(prediction.argmax()).
      Returns:
      An IdConverter.
    • features

      public Matrix features()
      Retrieves the dataset's feature matrix.
      Returns:
      A nodes x features Matrix.
    • labels

      public Matrix labels()
      Retrieves the dataset's sample labels in one-hot encoding.
      Returns:
      A nodes x classes Matrix.
    • graph

      public Matrix graph()
      Retrieves the dataset's graph.
      Returns:
      A Matrix or null if the dataset is feature-only.