Interface PatternReader<U,​S,​I>

Type Parameters:
U - type of the users.
S - type of the instance set.
I - type of an individual instance.
All Known Implementing Classes:
WekaInstanceReader

public interface PatternReader<U,​S,​I>
Class for reading machine learning patterns.
  • Method Summary

    Modifier and Type Method Description
    Features getFeatures()
    Gets the features.
    I getTestInstance​(U u, U v)
    Obtains a test instance for a pair of nodes
    S getTestSet()
    Obtains the test set instances
    S getTrainSet()
    Obtains the training set instances
    boolean readFeatures​(java.lang.String featureFile)
    Configures the features of the dataset.
    boolean readTest​(java.lang.String testFile, org.ranksys.formats.parsing.Parser<U> parser)
    Reads the test set.
    boolean readTrain​(java.lang.String trainFile)
    Reads the training set.
  • Method Details

    • readFeatures

      boolean readFeatures​(java.lang.String featureFile)
      Configures the features of the dataset.
      Parameters:
      featureFile - the file containing the description for the dataset features.
      Returns:
      true if everything went OK, false if not.
    • readTrain

      boolean readTrain​(java.lang.String trainFile)
      Reads the training set.
      Parameters:
      trainFile - file which contains the training instances.
      Returns:
      true if everything went ok, false if not.
    • readTest

      boolean readTest​(java.lang.String testFile, org.ranksys.formats.parsing.Parser<U> parser)
      Reads the test set.
      Parameters:
      testFile - file which contains the test instances
      parser - parser for the user identifiers.
      Returns:
      true if everything went OK, false if not.
    • getTrainSet

      S getTrainSet()
      Obtains the training set instances
      Returns:
      the training set instances
    • getTestSet

      S getTestSet()
      Obtains the test set instances
      Returns:
      the test set instances
    • getTestInstance

      I getTestInstance​(U u, U v)
      Obtains a test instance for a pair of nodes
      Parameters:
      u - the first node.
      v - the second node.
      Returns:
      null if the instance does not exist, a instance if it does.
    • getFeatures

      Features getFeatures()
      Gets the features.
      Returns:
      the features.