public class PredictionsSampler
extends java.lang.Object
| Constructor and Description |
|---|
PredictionsSampler(KB dataset) |
PredictionsSampler(KB dataset,
int sampleSize) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
generateBodyBindings(Rule rule)
Given a rule, it produces a sample from the body bindings of the rule.
|
java.lang.Object |
generateBodyPCABindings(Rule rule)
Given a rule, it produces a sample from the body* bindings
of the rule (the bindings that match the denominator of the
PCA confidence expression)
|
java.util.Set<Triple<ByteString,ByteString,ByteString>> |
generateBodyTriples(Rule rule,
boolean PCAMode) |
java.lang.Object |
generatePredictions(Rule rule)
Given a rule, it produces sample of predictions (triples that are beyond the database)
|
int |
getSampleSize() |
static void |
main(java.lang.String[] args) |
void |
runMode1(java.util.Collection<Rule> rules)
It takes a sample of unique predictions for the given rules by taking care of duplicated predictions.
|
void |
runMode2(java.util.Collection<Rule> rules)
It takes a sample of the predictions of every rule in the argument.
|
static java.util.Collection<Triple<ByteString,ByteString,ByteString>> |
sample(java.util.Collection<Triple<ByteString,ByteString,ByteString>> samplingCandidates,
int sampleSize)
Given a collection of predictions, it extracts a random sample from it.
|
void |
setNumberOfPredictions(int numberOfPredictions) |
public PredictionsSampler(KB dataset)
public PredictionsSampler(KB dataset, int sampleSize)
public int getSampleSize()
public void setNumberOfPredictions(int numberOfPredictions)
sampleSize - the sampleSize to setpublic java.util.Set<Triple<ByteString,ByteString,ByteString>> generateBodyTriples(Rule rule, boolean PCAMode)
public java.lang.Object generateBodyBindings(Rule rule)
rule - public java.lang.Object generateBodyPCABindings(Rule rule)
rule - public java.lang.Object generatePredictions(Rule rule)
rule - public void runMode1(java.util.Collection<Rule> rules)
rules - public void runMode2(java.util.Collection<Rule> rules)
rules - public static java.util.Collection<Triple<ByteString,ByteString,ByteString>> sample(java.util.Collection<Triple<ByteString,ByteString,ByteString>> samplingCandidates, int sampleSize)
samplingCandidates - public static void main(java.lang.String[] args)
throws java.io.IOException
args - java.io.IOException