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 nodesS
getTestSet()
Obtains the test set instancesS
getTrainSet()
Obtains the training set instancesboolean
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
Reads the test set.- Parameters:
testFile
- file which contains the test instancesparser
- 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
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.
-