|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.util.nptgenerator.Function
uk.co.agena.minerva.util.nptgenerator.Normal
public class Normal
Example use of NPT Generator with Normal Function is as follows for a Given net with parents p1,p2 and p3 of a node named "child": ExtendedBN ebn = (ExtendedBN) this.currentModel.getExtendedBNList().getExtendedBNs().get(0); List possibileNodes = ebn.getExtendedNodes("child"); ContinuousIntervalEN enode = (ContinuousIntervalEN)possibileNodes.get(0); // Upto here we are just getting the Interval Node with name "child" // Now define a Normal on this node with the ExtendedBN and the equation for mean // and variance using the parents names. Normal normal = Normal.Normal(ebn, enode, "(p1+p2)/2", "p3"); // We state if we require sampling. normal.setForceSampling(true); //Now actually Generate the NPT normal.generateNPTUsingSampling(); //View the NPT normal.printNPT(); //this now Stores the NPT to the node normal.storeNPTtoNode(); // Now reinitialise the ExtendedBn to incorporate the new NPT generated. ebn.reinitialise();
Field Summary | |
---|---|
static java.lang.String |
displayName
|
static java.lang.String[] |
parameterDisplayNames
|
Fields inherited from class uk.co.agena.minerva.util.nptgenerator.Function |
---|
ALLOWED_CHARACTERS, NEWLINE, TAB, VARIANCE_MAP, WEIGHTED_FUNCTIONS |
Constructor Summary | |
---|---|
Normal(ExtendedNode extendedNode,
java.util.List parents,
java.lang.String[] expressions)
|
Method Summary | |
---|---|
void |
calculateProbability(DataSet values)
This will calculate the normal and add it to the relevant cell of the npt using the rowMajorParentStateCombIndex |
java.lang.String |
getDisplayName()
Shows the name of the Function subclass as it should be displayed in a GUI etc. |
java.lang.String[] |
getParameterDisplayNames()
Shows the name of the parameters of the Function subclass as they should be displayed in a GUI etc. |
static Normal |
Normal(ExtendedNode extendedNode,
java.util.List parents,
java.util.List functionParams)
Will Generate a normal using the node and its parent nodes. |
static double[] |
Normal(java.util.List ranges,
double mean,
double variance)
calculates the normal over a defined set of ranges given a mean and a variance. |
java.lang.String |
toString()
Returns a String representation of the object. |
Methods inherited from class uk.co.agena.minerva.util.nptgenerator.Function |
---|
calculateFunction, createFunction, evaluateExpressionAsDouble, evaluateExpressionAsObject, generateNPTForNodeWithoutSampling, getDummyWeightedFunctionFromTrueName, getMaximumValueReached, getMinimumValueReached, getSingleColumnNPT, isForceSampling, requiresSampling, resetParserCache, setForceSampling, setMaximumValueReached, setMinimumValueReached, setPossibleMaxOrMinVaule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String displayName
public static java.lang.String[] parameterDisplayNames
Constructor Detail |
---|
public Normal(ExtendedNode extendedNode, java.util.List parents, java.lang.String[] expressions) throws NPTGeneratorException, InconsistentEvidenceException
NPTGeneratorException
InconsistentEvidenceException
Method Detail |
---|
public static Normal Normal(ExtendedNode extendedNode, java.util.List parents, java.util.List functionParams) throws NPTGeneratorException, InconsistentEvidenceException
ebn
- extendedFunctionNode
- meanExp
- varianceExp
-
NPTGeneratorException
InconsistentEvidenceException
public static double[] Normal(java.util.List ranges, double mean, double variance)
ranges
- mean
- variance
-
public void calculateProbability(DataSet values) throws NPTGeneratorException
calculateProbability
in class Function
rowMajorParentStateCombIndex
- values
-
NPTGeneratorException
public java.lang.String toString()
toString
in class Function
The
- String representation.public java.lang.String getDisplayName()
Function
getDisplayName
in class Function
public java.lang.String[] getParameterDisplayNames()
Function
getParameterDisplayNames
in class Function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |