edu.ksu.cis.bnj.bbn.learning.score
Class WeightedBDEScore
java.lang.Object
edu.ksu.cis.bnj.bbn.learning.LearnerScore
edu.ksu.cis.bnj.bbn.learning.score.BDEScore
edu.ksu.cis.bnj.bbn.learning.score.WeightedBDEScore
- public class WeightedBDEScore
- extends BDEScore
Method Summary |
double |
getScore(int curNode,
int candidate,
java.util.Set[] parentTable)
BDE scoring is:
g(vi, parents(vi)) = \Pi_{j=1}^{qi} ((ri-1)! |
void |
initialize()
This is just to reset the cache. |
protected void |
iterateUniqueInstantiation(int depth,
TableTally tally)
Recursively filter out the data according to the current node (Roby Joehanes) |
protected static double |
stirlingGosperApprox(double n)
Stirling-Gosper approximation for ln n! |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
oneThird
public static final double oneThird
- See Also:
- Constant Field Values
lnPi
public static final double lnPi
WeightedBDEScore
public WeightedBDEScore()
WeightedBDEScore
public WeightedBDEScore(Learner l)
getScore
public double getScore(int curNode,
int candidate,
java.util.Set[] parentTable)
- Description copied from class:
BDEScore
- BDE scoring is:
g(vi, parents(vi)) = \Pi_{j=1}^{qi} ((ri-1)!/(Nij+ri-1)!) \Pi_{k=1}^{ri}
Nijk!
With:
vi is the node being queried
qi is the unique instantiation of vi's parents
ri is vi's arity
Nij is the total number of unique cases of one unique instantiation
Nijk is the total number of unique cases of one unique instantiation that
contains the value of r_ik.
Then, we do a logarithm out of g.
In short, UTSL or RTFP.
- Overrides:
getScore
in class BDEScore
- See Also:
edu.ksu.cis.bnj.bbn.learning.LearnerScore#score(java.lang.String, java.util.Set)
stirlingGosperApprox
protected static double stirlingGosperApprox(double n)
- Stirling-Gosper approximation for ln n! (Roby Joehanes)
ln n! = 0.5*(ln(2*n+ 1/3) + ln pi) + n ln n - n
I did this because the weights may be real valued
iterateUniqueInstantiation
protected void iterateUniqueInstantiation(int depth,
TableTally tally)
- Recursively filter out the data according to the current node (Roby Joehanes)
- Parameters:
depth
- tally
-
initialize
public void initialize()
- This is just to reset the cache. But since it is not dependent on
tuple numbers, we can simply ignore this.
- Overrides:
initialize
in class LearnerScore
- See Also:
LearnerScore.initialize()