|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.NetworkModel
COM.hugin.HAPI.Domain
Instances of the Domain class represent Bayesian networks and LIMIDs in which you can propagate evidence and calculate updated beliefs and expected utilities.
Nested Class Summary | |
static class |
Domain.Equilibrium
The Equilibrium class represents the equilibrium state of this Domain. |
static class |
Domain.EvidenceMode
The EvidenceMode class represents the mode used for propagating evidence in this Domain. |
static class |
Domain.TriangulationMethod
The TriangulationMethod class represents the triangulation method used for this Domain. |
Nested classes inherited from class COM.hugin.HAPI.NetworkModel |
NetworkModel.Category, NetworkModel.Constraint, NetworkModel.Kind |
Field Summary | |
static Domain.Equilibrium |
H_EQUILIBRIUM_MAX
Represents max equilibrium. |
static Domain.Equilibrium |
H_EQUILIBRIUM_SUM
Represents sum equilibrium. |
static Domain.EvidenceMode |
H_EVIDENCE_MODE_FAST_RETRACTION
Represents the fast-retraction evidence mode used for propagating evidence in this Domain. |
static Domain.EvidenceMode |
H_EVIDENCE_MODE_NORMAL
Represents the normal evidence mode used for propagating evidence in this Domain. |
static Domain.TriangulationMethod |
H_TM_BEST_GREEDY
Represents the best-greedy triangulation heuristic. |
static Domain.TriangulationMethod |
H_TM_CLIQUE_SIZE
Represents the clique-size triangulation heuristic. |
static Domain.TriangulationMethod |
H_TM_CLIQUE_WEIGHT
Represents the clique-weight triangulation heuristic. |
static Domain.TriangulationMethod |
H_TM_FILL_IN_SIZE
Represents the fill-in-size triangulation heuristic. |
static Domain.TriangulationMethod |
H_TM_FILL_IN_WEIGHT
Represents the fill-in-weight triangulation heuristic. |
static Domain.TriangulationMethod |
H_TM_TOTAL_WEIGHT
Represents the total clique-table size triangulation algorithm. |
Constructor Summary | |
Domain()
Constructs a new empty Domain. |
|
Domain(Class cls)
Constructs a runtime domain from a Class object. |
|
Domain(Class cls,
int numberOfSlices)
Constructs a DBN runtime domain from a Class object. |
|
Domain(java.lang.String hkbFileName)
Constructs a domain by loading the corresponding Hugin Knowledge Base (HKB) file. |
|
Domain(java.lang.String netStringOrFileName,
ParseListener parseListener)
Constructs a domain from a NET file or a NET description given as a string. |
|
Domain(java.lang.String hkbFileName,
java.lang.String password)
Constructs a domain by loading the corresponding Hugin Knowledge Base (HKB) file. |
Method Summary | |
void |
adapt()
Adapts this Domain according to the evidence propagated. |
void |
adaptClassTablesUsingFractionalUpdate()
Adapts (using the Fractional Update algorithm) the tables of the nodes in the class with the evidence propagated in this runtime Domain. |
void |
adaptClassTablesUsingOnlineEM(double rho)
Adapts (using the Online EM algorithm) the tables of the nodes in the class with the evidence propagated in this runtime Domain. |
void |
addCases(DataSet dataSet)
Adds all rows of the data set to this Domain as cases. |
void |
addCases(DataSet dataSet,
int start,
int count)
Adds the specified range of rows of the data set to this Domain as cases. |
double |
approximate(double epsilon)
Removes "near-zero" probabilities from the clique probability tables. |
boolean |
cgEvidenceIsPropagated()
Returns true if evidence on CG nodes has been
propagated; otherwise, returns false . |
java.lang.Object |
clone()
Clones this Domain. |
void |
compile()
Compiles this Domain. |
void |
compile(Domain.TriangulationMethod method)
Compiles and triangulates this Domain using the specified triangulation method. |
void |
compile(NodeList eliminationOrder)
Compiles and triangulates this Domain using the specified elimination order. |
double |
compress()
Removes the zero entries from the clique and separator tables of the JunctionTrees in this Domain. |
void |
computeDBNPredictions(int numberOfTimePoints)
Computes predictions for numberOfTimePoints time
slices beyond the current time window. |
void |
computeSensitivityData(NodeList nodes,
int[] states)
Computes the constants of the sensitivity functions for the specified output probabilities and all CPT parameters in the network. |
void |
delete()
Deletes this Domain, including all Node and JunctionTree objects belonging to it. |
void |
enterCase(int c)
Enters a case as evidence. |
boolean |
equilibriumIs(Domain.Equilibrium equilibrium)
Tests for Equilibrium type. |
boolean |
evidenceIsPropagated()
Tests if evidence has been propagated for this Domain. |
boolean |
evidenceModeIs(Domain.EvidenceMode evidenceMode)
Tests for evidence mode. |
boolean |
evidenceToPropagate()
Tests if evidence has been entered since the last propagation. |
void |
findMAPConfigurations(NodeList nodes,
double minProbability)
Finds all configurations of nodes with probability
at least minProbability . |
void |
fineTuneNBTables(Node target)
Fine-tunes a Naive Bayes (NB) model using training data. |
double |
getAIC()
Computes the AIC score (Akaike's Information Criterion) of the case data. |
double |
getApproximationConstant()
Returns the approximation constant. |
double |
getBIC()
Computes the BIC score (Bayesian Information Criterion) of the case data. |
double |
getCaseCount(int c)
Returns case count for a case. |
int |
getConcurrencyLevel()
Gets the current level of concurrency. |
double |
getConflict()
Returns the conflict value. |
int |
getDBNWindowOffset()
Returns the total number of time steps that the time window of this DBN runtime domain has been moved. |
NodeList |
getDConnectedNodes(NodeList source,
NodeList evidence)
Performs a d-separation test and returns a list of d-connected nodes. |
NodeList |
getDConnectedNodes(NodeList source,
NodeList hard,
NodeList soft)
Performs a d-separation test and returns a list of d-connected nodes. |
NodeList |
getDSeparatedNodes(NodeList source,
NodeList evidence)
Performs a d-separation test and returns a list of d-separated nodes. |
NodeList |
getDSeparatedNodes(NodeList source,
NodeList hard,
NodeList soft)
Performs a d-separation test and returns a list of d-separated nodes. |
NodeList |
getEliminationOrder()
Returns the triangulation order. |
int |
getEMConcurrencyLevel()
Returns the number of threads to be created by the EM algorithm. |
double |
getExpectedUtility()
Returns the total expected utility associated with this Domain. |
NodeList |
getExplanation(int index)
Returns the evidence subset associated with the explanation of rank index computed by the most recent call to
computeExplanationData . |
double |
getExplanationScore(int index)
Returns the score of the specified explanation. |
int |
getGrainSize()
Returns the current value of the grain size parameter. |
JunctionTreeList |
getJunctionTrees()
Returns the JunctionTrees of this Domain. |
double |
getLogLikelihood()
Computes the log-likelihood of the case data. |
double |
getLogLikelihoodTolerance()
Returns the log-likelihood tolerance for this Domain. |
double |
getLogNormalizationConstant()
Returns the logarithm of the normalization constant. |
int[] |
getMAPConfiguration(int index)
Returns a MAP configuration. |
Table |
getMarginal(NodeList nodes)
Computes the marginal distribution for the Nodes provided as argument with respect to the (imaginary) joint potential, determined by the current potentials on the JunctionTree(s) of this Domain. |
int |
getMaxNumberOfEMIterations()
Returns the maximum number of iterations allowed for the EM algorithm. |
int |
getMaxNumberOfSeparators()
Returns the maximum number of separators allowed when using the H_TM_TOTAL_WEIGHT TriangulationMethod. |
int |
getMaxSeparatorSize()
Returns the maximum separator size allowed when using the H_TM_TOTAL_WEIGHT TriangulationMethod. |
int |
getNBFineTuneIterationsLimit()
Returns the limit for the number of consecutive failed iterations of the Naive Bayes (NB) fine-tuning algorithm. |
double |
getNBFineTuneLearningRate()
Returns the learning rate of the Naive Bayes (NB) fine-tuning algorithm. |
double |
getNormalDeviate(double mean,
double variance)
Use the pseudo-random number generator for this Domain to sample a real number from a normal (aka Gaussian) distribution. |
double |
getNormalizationConstant()
Retrieves the normalization constant for the most recent propagation. |
int |
getNumberOfCases()
Returns the number of data cases. |
int |
getNumberOfExplanations()
Returns the number of explanations. |
int |
getNumberOfMAPConfigurations()
Returns the number of MAP configurations. |
double |
getProbabilityOfMAPConfiguration(int index)
Returns the probability of a MAP configuration. |
NodeList |
getSensitivitySet()
Returns the sensitivity set computed by the most recent call to computeSensitivityData . |
NodeList |
getSensitivitySet(int output)
Returns the sensitivity set computed by the most recent call to computeSensitivityData . |
double |
getSignificanceLevel()
Returns the significance level of the dependency tests performed during structure learning using the PC algorithm. |
double |
getUniformDeviate()
Use the pseudo-random number generator for this Domain to sample a real number from the uniform distribution over the interval [0,1). |
void |
initialize()
Establishes the initial values for all tables of this Domain (which must be compiled). |
void |
initializeDBNWindow()
Moves the time window of this DBN back to its initial position, and removes all evidence. |
boolean |
isCompiled()
Tests whether this Domain is compiled. |
boolean |
isCompressed()
Tests whether this Domain is compressed. |
boolean |
isTriangulated()
Tests whether this Domain is triangulated. |
boolean |
isTriangulatedForBK()
Tests whether this Domain is triangulated for Boyen-Koller approximate inference. |
void |
learnClassTables()
Learns the conditional probability tables of the class nodes, from which the domain is created, from data using the EM algorithm. |
void |
learnHNBStructure(Node target)
Learns a Hierarchical Naive Bayes (HNB) model from data. |
void |
learnStructure()
Learns the structure (graph) of the Bayesian network from data using the PC algorithm. |
void |
learnTables()
Learns the conditional probability tables from data using the EM algorithm. |
void |
learnTreeStructure()
Learns a tree-structured network model from data. |
void |
learnTreeStructure(Node root)
Learns a tree-structured network model from data. |
void |
learnTreeStructure(Node root,
Node target)
Learns a tree-structured network model from data. |
boolean |
likelihoodIsPropagated()
Tests if likelihood evidence has been propagated for this Domain. |
void |
moveDBNWindow(int delta)
Slides the time window of this DBN delta steps
into the future. |
int |
newCase()
Creates a new case. |
void |
parseCase(java.lang.String fileName,
ParseListener parseListener)
Parses the case stored in file fileName and enters
the associated findings into this Domain. |
void |
parseCases(java.lang.String fileName,
ParseListener parseListener)
Parses the cases stored in file fileName and enters
the cases into this Domain. |
void |
propagate(Domain.Equilibrium equilibrium,
Domain.EvidenceMode evidenceMode)
Establishes the specified equilibrium using the evidence mode indicated for incorporation of evidence on all JunctionTrees of this Domain. |
void |
resetInferenceEngine()
Establishes the initial state of the inference engine, which is sum-equilibrium with no evidence incorporated. |
void |
retractFindings()
Retracts (all) evidence for all nodes in this Domain. |
void |
saveAsKB(java.lang.String fileName)
Saves this Domain as a Hugin Knowledge Base (HKB) file. |
void |
saveAsKB(java.lang.String fileName,
java.lang.String password)
Saves this Domain as a password-protected Hugin Knowledge Base (HKB) file. |
void |
saveCase(java.lang.String fileName)
Saves all evidence entered in this Domain in file fileName (if the file exists, it is overwritten). |
void |
saveCases(java.lang.String fileName,
NodeList nodes,
int[] cases,
boolean caseCounts,
java.lang.String separator,
java.lang.String missingData)
Saves all cases entered in this Domain in a file with the given fileName (if the file exists, it is overwritten). |
void |
saveToMemory()
Creates a copy in memory of the belief and JunctionTree tables of this Domain. |
void |
seedRandom(int seed)
Seeds the pseudo-random number generator for this Domain. |
void |
setCaseCount(int c,
double count)
Sets case count for a case. |
void |
setConcurrencyLevel(int level)
Sets the level of concurrency. |
void |
setEMConcurrencyLevel(int level)
Sets the number of threads to be created by the EM algorithm. |
void |
setGrainSize(int size)
Sets the grain size parameter. |
void |
setInitialTriangulation(NodeList order)
Sets an initial triangulation for this Domain. |
void |
setLogLikelihoodTolerance(double tolerance)
Sets the log-likelihood tolerance for this Domain. |
void |
setMaxNumberOfEMIterations(int m)
Sets the maximum number of iterations allowed for the EM algorithm. |
void |
setMaxNumberOfSeparators(int m)
Sets the maximum number of separators allowed when using the H_TM_TOTAL_WEIGHT TriangulationMethod. |
void |
setMaxSeparatorSize(int size)
Sets the maximum separator size for the H_TM_TOTAL_WEIGHT TriangulationMethod. |
void |
setNBFineTuneIterationsLimit(int limit)
Sets the limit for the number of consecutive failed iterations of the Naive Bayes (NB) fine-tuning algorithm. |
void |
setNBFineTuneLearningRate(double learningRate)
Sets the learning rate of the Naive Bayes (NB) fine-tuning algorithm. |
void |
setNumberOfCases(int size)
Sets the number of cases. |
void |
setSignificanceLevel(double alpha)
Sets the significance level of the dependency tests performed during structure learning using the PC algorithm. |
void |
simulate()
Generates a sample configuration from the joint distribution represented by this Domain. |
boolean |
tablesToPropagate()
Tests for new node tables. |
void |
triangulate()
Triangulates the graph of this Domain using the default triangulation method. |
void |
triangulate(Domain.TriangulationMethod tm)
Triangulates the graph of this Domain using the specified triangulation method. |
void |
triangulate(NodeList order)
Triangulates the graph of this Domain using the specified elimination order. |
void |
triangulateDBN(Domain.TriangulationMethod tm)
Triangulates a DBN runtime Domain for exact inference. |
void |
triangulateDBNForBK(Domain.TriangulationMethod tm)
Triangulates a DBN runtime Domain for approximate inference. |
void |
uncompile()
Uncompiles this Domain. |
void |
updatePolicies()
Updates the policy tables of the domain. |
Methods inherited from class COM.hugin.HAPI.NetworkModel |
closeLogFile, generateTables, getAttribute, getAttributes, getFileName, getLogFile, getNodeByName, getNodes, getNodeSize, getUserData, INFINITY, isAlive, openLogFile, openLogFile, parseNodes, saveAsNet, setAttribute, setNodeSize, setUserData, toNetString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Domain.Equilibrium H_EQUILIBRIUM_SUM
propagate(Equilibrium, EvidenceMode)
.
public static final Domain.Equilibrium H_EQUILIBRIUM_MAX
propagate(Equilibrium, EvidenceMode)
.
public static final Domain.EvidenceMode H_EVIDENCE_MODE_NORMAL
public static final Domain.EvidenceMode H_EVIDENCE_MODE_FAST_RETRACTION
public static final Domain.TriangulationMethod H_TM_CLIQUE_SIZE
public static final Domain.TriangulationMethod H_TM_CLIQUE_WEIGHT
public static final Domain.TriangulationMethod H_TM_FILL_IN_SIZE
public static final Domain.TriangulationMethod H_TM_FILL_IN_WEIGHT
public static final Domain.TriangulationMethod H_TM_BEST_GREEDY
public static final Domain.TriangulationMethod H_TM_TOTAL_WEIGHT
setMaxNumberOfSeparators
.
Constructor Detail |
public Domain() throws ExceptionHugin
public Domain(java.lang.String hkbFileName, java.lang.String password) throws ExceptionHugin
hkbFileName
- the name of the HKB file.password
- a password needed to load the file.public Domain(java.lang.String hkbFileName) throws ExceptionHugin
hkbFileName
- the name of the HKB file.public Domain(java.lang.String netStringOrFileName, ParseListener parseListener) throws ExceptionHugin
netStringOrFileName
- a string containing a NET
description or the name of a NET fileparseListener
- the ParseListener used for handling
parse errors.public Domain(Class cls) throws ExceptionHugin
cls
- the Class object to instantiate.public Domain(Class cls, int numberOfSlices) throws ExceptionHugin
cls
- the Class object describing a single time slicenumberOfSlices
- the number of time slicesMethod Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public void delete() throws ExceptionHugin
delete
in class NetworkModel
ExceptionHugin
public double approximate(double epsilon) throws ExceptionHugin
epsilon
- the threshold value. Maximal probability
mass to eradicate from each clique.
ExceptionHugin
public boolean cgEvidenceIsPropagated() throws ExceptionHugin
true
if evidence on CG nodes has been
propagated; otherwise, returns false
.
ExceptionHugin
public void compile() throws ExceptionHugin
ExceptionHugin
public void compile(NodeList eliminationOrder) throws ExceptionHugin
eliminationOrder
- an ordered NodeList used as basis for
constructing the triangulated graph (and in turn the
JunctionTree).
ExceptionHugin
public void compile(Domain.TriangulationMethod method) throws ExceptionHugin
method
- the triangulation method used.
ExceptionHugin
public double compress() throws ExceptionHugin
ExceptionHugin
public boolean equilibriumIs(Domain.Equilibrium equilibrium) throws ExceptionHugin
true
if the
equilibrium states of all JunctionTrees of this Domain are
identical to equilibrium
.
equilibrium
- the type of Equilibrium to test for.
ExceptionHugin
public boolean evidenceIsPropagated() throws ExceptionHugin
true
if it has; otherwise, returns
false
.
ExceptionHugin
public boolean evidenceModeIs(Domain.EvidenceMode evidenceMode) throws ExceptionHugin
true
if the
equilibrium states of all JunctionTrees of this Domain could
have been obtained through a propagation using
evidenceMode
as the evidence incorporation
mode. Otherwise, returns false
.
evidenceMode
- the type of EvidenceMode to test for.
ExceptionHugin
public boolean evidenceToPropagate() throws ExceptionHugin
true
if it has; otherwise,
returns false
.
ExceptionHugin
public double getApproximationConstant() throws ExceptionHugin
ExceptionHugin
public double getConflict() throws ExceptionHugin
ExceptionHugin
public NodeList getEliminationOrder() throws ExceptionHugin
ExceptionHugin
public JunctionTreeList getJunctionTrees() throws ExceptionHugin
ExceptionHugin
public Table getMarginal(NodeList nodes) throws ExceptionHugin
nodes
contains continuous nodes,
they must be last in the list. This operation is not allowed on
compressed Domains.
nodes
- a NodeList containing the Nodes over which to
compute the marginal.
nodes
.
ExceptionHugin
public void findMAPConfigurations(NodeList nodes, double minProbability) throws ExceptionHugin
nodes
with probability
at least minProbability
. This method uses a Monte
Carlo algorithm to solve a generalized form of the maximum
a posteriori (MAP) configuration problem: The MAP
configuration problem is the problem of finding the most
probable configuration of a set of nodes given evidence on some
of the remaining nodes.
The results of this method are provided by getNumberOfMAPConfigurations
,
getMAPConfiguration
, and getProbabilityOfMAPConfiguration
.
nodes
- a NodeList containing the DiscreteNodes for which
to find configurations.minProbability
- configurations with a lower probability
than minProbability
are ignored.
ExceptionHugin
public int getNumberOfMAPConfigurations() throws ExceptionHugin
findMAPConfigurations
.
ExceptionHugin
public int[] getMAPConfiguration(int index) throws ExceptionHugin
index
among the
configurations with probability at least
minProbability
— as specified in the most recent
successful call to findMAPConfigurations
.
The index
argument must be a nonnegative
integer less than getNumberOfMAPConfigurations
: 0 requests the most probable
configuration, 1 the second-most probable configuration,
etc.
index
- identifies the configuration.
ExceptionHugin
public double getProbabilityOfMAPConfiguration(int index) throws ExceptionHugin
getMAPConfiguration(index)
index
- identifies the configuration.
ExceptionHugin
public double getNormalizationConstant() throws ExceptionHugin
ExceptionHugin
public double getExpectedUtility() throws ExceptionHugin
ExceptionHugin
public void initialize() throws ExceptionHugin
ExceptionHugin
public boolean isTriangulated() throws ExceptionHugin
ExceptionHugin
public boolean isCompiled() throws ExceptionHugin
ExceptionHugin
public boolean isCompressed() throws ExceptionHugin
ExceptionHugin
public boolean likelihoodIsPropagated() throws ExceptionHugin
true
if it has; otherwise, returns
false
.
ExceptionHugin
public void propagate(Domain.Equilibrium equilibrium, Domain.EvidenceMode evidenceMode) throws ExceptionHugin
equilibrium
- Equilibrium type. The normal Equilibrium
type is Domain.H_EQUILIBRIUM_SUM.evidenceMode
- EvidenceMode type. The normal EvidenceMode
type is Domain.H_EVIDENCE_MODE_NORMAL.
ExceptionHugin
public void resetInferenceEngine() throws ExceptionHugin
ExceptionHugin
public void retractFindings() throws ExceptionHugin
ExceptionHugin
public void saveAsKB(java.lang.String fileName, java.lang.String password) throws ExceptionHugin
password
is non-null, the file
will be password protected. This password must be used in
order to load the file.
fileName
- the name of the file to which the HKB is saved.password
- if non-null, this must be used in order to load
the file.
ExceptionHugin
public void saveAsKB(java.lang.String fileName) throws ExceptionHugin
fileName
- the name of the HKB file.
ExceptionHugin
public void saveToMemory() throws ExceptionHugin
ExceptionHugin
public void simulate() throws ExceptionHugin
ExceptionHugin
public void seedRandom(int seed) throws ExceptionHugin
seed
- the seed number.
ExceptionHugin
public double getUniformDeviate() throws ExceptionHugin
ExceptionHugin
public double getNormalDeviate(double mean, double variance) throws ExceptionHugin
mean
- the mean of the distributionvariance
- the variance of the distribution
ExceptionHugin
public boolean tablesToPropagate() throws ExceptionHugin
true
if there
is a node in this Domain having a (conditional probability,
policy, or utility) table that has changed since the most
recent compilation or propagation; otherwise, returns
false
.
ExceptionHugin
public void triangulate(Domain.TriangulationMethod tm) throws ExceptionHugin
tm
- the TriangulationMethod to use.
ExceptionHugin
public void triangulate() throws ExceptionHugin
ExceptionHugin
public void triangulate(NodeList order) throws ExceptionHugin
order
- a NodeList containing the Nodes of the network
in the order of elimination
ExceptionHugin
public void uncompile() throws ExceptionHugin
ExceptionHugin
public void setConcurrencyLevel(int level) throws ExceptionHugin
level
- the level of concurrency.
ExceptionHugin
public void setGrainSize(int size) throws ExceptionHugin
The initial value of the grain size parameter is 10000.
size
- the grain size.
ExceptionHugin
public int getConcurrencyLevel() throws ExceptionHugin
ExceptionHugin
setConcurrencyLevel
public int getGrainSize() throws ExceptionHugin
ExceptionHugin
public double getLogNormalizationConstant() throws ExceptionHugin
ExceptionHugin
public void setNumberOfCases(int size) throws ExceptionHugin
ExceptionHugin
public int newCase() throws ExceptionHugin
ExceptionHugin
public int getNumberOfCases() throws ExceptionHugin
ExceptionHugin
public void setCaseCount(int c, double count) throws ExceptionHugin
c
- the case for which to set the count.count
- the multiplicity of c
.
ExceptionHugin
public double getCaseCount(int c) throws ExceptionHugin
c
- the case for which to get the count.
c
.
ExceptionHugin
public void enterCase(int c) throws ExceptionHugin
c
- the case to enter.
ExceptionHugin
public void learnTables() throws ExceptionHugin
ExceptionHugin
public void learnClassTables() throws ExceptionHugin
ExceptionHugin
public void setLogLikelihoodTolerance(double tolerance) throws ExceptionHugin
ExceptionHugin
public double getLogLikelihoodTolerance() throws ExceptionHugin
ExceptionHugin
public void setMaxNumberOfEMIterations(int m) throws ExceptionHugin
ExceptionHugin
public int getMaxNumberOfEMIterations() throws ExceptionHugin
ExceptionHugin
public void setEMConcurrencyLevel(int level) throws ExceptionHugin
level
- the level of concurrency (must be a positive number).
ExceptionHugin
public int getEMConcurrencyLevel() throws ExceptionHugin
ExceptionHugin
setEMConcurrencyLevel
public double getLogLikelihood() throws ExceptionHugin
ExceptionHugin
public double getAIC() throws ExceptionHugin
ExceptionHugin
public double getBIC() throws ExceptionHugin
ExceptionHugin
public void adapt() throws ExceptionHugin
ExceptionHugin
public void adaptClassTablesUsingFractionalUpdate() throws ExceptionHugin
ExceptionHugin
public void adaptClassTablesUsingOnlineEM(double rho) throws ExceptionHugin
rho
- the parameter used to determine the "learning
rate" of the Online EM algorithm.
ExceptionHugin
public void learnStructure() throws ExceptionHugin
ExceptionHugin
public void setSignificanceLevel(double alpha) throws ExceptionHugin
alpha
- the significance level.
ExceptionHugin
public double getSignificanceLevel() throws ExceptionHugin
ExceptionHugin
public void learnTreeStructure(Node root, Node target) throws ExceptionHugin
root
as root is learned. This tree is turned into
a TAN model by adding target
as parent of all
other nodes of this Domain.
The domain must contain only chance nodes and no edges. Case
data must be specified in advance.
root
- all edges of the Chow-Liu tree will be directed
away from root
target
- the class variable of the TAN model.
ExceptionHugin
public void learnTreeStructure(Node root) throws ExceptionHugin
root
.
The domain must contain only chance nodes and no edges. Case
data must be specified in advance.
root
- all edges of the tree will be directed away from
root
ExceptionHugin
public void learnTreeStructure() throws ExceptionHugin
ExceptionHugin
public void learnHNBStructure(Node target) throws ExceptionHugin
target
variable must be a discrete node. Case
data must be specified in advance.
target
- the class variable of the HNB model.
ExceptionHugin
public void fineTuneNBTables(Node target) throws ExceptionHugin
target
- the class variable of the Naive Bayes model.
ExceptionHugin
public void setNBFineTuneLearningRate(double learningRate) throws ExceptionHugin
learningRate
- a number between 0 and 1.
ExceptionHugin
public double getNBFineTuneLearningRate() throws ExceptionHugin
ExceptionHugin
public void setNBFineTuneIterationsLimit(int limit) throws ExceptionHugin
limit
iterations over the training data, showing
no improvements of the classification accuracy, have been
performed, the algorithm terminates.
The default value is 1.
limit
- a positive integer.
ExceptionHugin
public int getNBFineTuneIterationsLimit() throws ExceptionHugin
ExceptionHugin
public void setInitialTriangulation(NodeList order) throws ExceptionHugin
H_TM_TOTAL_WEIGHT
triangulation method. The purpose is to (1)
improve the generated triangulation, and (2) to reduce the
run-time of the algorithm. The triangulation must be specified
in the form of an elimination sequence.
order
- a NodeList containing the Nodes of the network
in the order of elimination
ExceptionHugin
public void setMaxNumberOfSeparators(int m) throws ExceptionHugin
ExceptionHugin
public void setMaxSeparatorSize(int size) throws ExceptionHugin
An initial
triangulation is required in order to use this feature, see
setInitialTriangulation
.
If zero is specified for the maximum separator size, then no separators will be discarded.
ExceptionHugin
public int getMaxNumberOfSeparators() throws ExceptionHugin
ExceptionHugin
public int getMaxSeparatorSize() throws ExceptionHugin
ExceptionHugin
public void parseCase(java.lang.String fileName, ParseListener parseListener) throws ExceptionHugin
fileName
and enters
the associated findings into this Domain. All existing
evidence in the Domain is retracted before entering the case
findings.
fileName
- the name of the file containing the case.parseListener
- the ParseListener used for handling
parse errors.
ExceptionHugin
public void saveCase(java.lang.String fileName) throws ExceptionHugin
fileName
(if the file exists, it is overwritten).
fileName
- the name of the file in which the case is going
to be saved.
ExceptionHugin
public void saveCases(java.lang.String fileName, NodeList nodes, int[] cases, boolean caseCounts, java.lang.String separator, java.lang.String missingData) throws ExceptionHugin
fileName
- the name of the file in which the case is going
to be saved.nodes
- A list of all nodes which are to be included in the filecases
- An array of case indexes specifying the cases to
be included in the file. Passing NULL for this argument will
include all cases.caseCounts
- If true, include case counts in the data file. If
false, only include case counts if they are present in the domain.separator
- The string used to seperate the items in the filemissingData
- The string used to represent missing data
ExceptionHugin
public void parseCases(java.lang.String fileName, ParseListener parseListener) throws ExceptionHugin
fileName
and enters
the cases into this Domain.
fileName
- the name of the file containing the cases.parseListener
- the ParseListener used for handling
parse errors.
ExceptionHugin
public NodeList getDConnectedNodes(NodeList source, NodeList hard, NodeList soft) throws ExceptionHugin
source
- list of source nodeshard
- list of nodes assumed to be instantiatedsoft
- list of nodes assumed to have multi-state or
likelihood evidence.
ExceptionHugin
public NodeList getDConnectedNodes(NodeList source, NodeList evidence) throws ExceptionHugin
source
- list of source nodesevidence
- list of nodes assumed to be instantiated.
ExceptionHugin
public NodeList getDSeparatedNodes(NodeList source, NodeList hard, NodeList soft) throws ExceptionHugin
source
- list of source nodeshard
- list of nodes assumed to be instantiatedsoft
- list of nodes assumed to have multi-state or
likelihood evidence.
ExceptionHugin
public NodeList getDSeparatedNodes(NodeList source, NodeList evidence) throws ExceptionHugin
source
- list of source nodesevidence
- list of nodes assumed to be instantiated.
ExceptionHugin
public void computeSensitivityData(NodeList nodes, int[] states) throws ExceptionHugin
nodes
- the list of (output) nodesstates
- a list of states of the nodes in the
nodes
list
ExceptionHugin
public NodeList getSensitivitySet() throws ExceptionHugin
computeSensitivityData
. If the results produced by that call
have been invalidated, a usage exception is thrown.
ExceptionHugin
public NodeList getSensitivitySet(int output) throws ExceptionHugin
computeSensitivityData
.
If the results produced by that call have been invalidated, a
usage exception is thrown.
output
- identifies one of the output probabilities
specified in the call to computeSensitivityData
.
ExceptionHugin
public int getNumberOfExplanations() throws ExceptionHugin
computeExplanationData
.
ExceptionHugin
public NodeList getExplanation(int index) throws ExceptionHugin
index
computed by the most recent call to
computeExplanationData
.
index
- specifies that the index
th best
explanation should be retrieved (the best explanation has index
0, the second best has index 1, etc.)
ExceptionHugin
public double getExplanationScore(int index) throws ExceptionHugin
getExplanation(index)
index
- identifies the explanation.
ExceptionHugin
public void updatePolicies() throws ExceptionHugin
ExceptionHugin
public void addCases(DataSet dataSet) throws ExceptionHugin
ExceptionHugin
public void addCases(DataSet dataSet, int start, int count) throws ExceptionHugin
start
- the index of the first row to addcount
- the number of rows to add.
ExceptionHugin
public void triangulateDBN(Domain.TriangulationMethod tm) throws ExceptionHugin
tm
- the TriangulationMethod to use.
ExceptionHugin
public void triangulateDBNForBK(Domain.TriangulationMethod tm) throws ExceptionHugin
tm
- the TriangulationMethod to use.
ExceptionHugin
public boolean isTriangulatedForBK() throws ExceptionHugin
ExceptionHugin
public void moveDBNWindow(int delta) throws ExceptionHugin
delta
steps
into the future. This Domain must have been produced by createDBNDomain
, and it must have been
triangulated using triangulateDBN
.
delta
- the number of time steps to slide the time window
(this must be a positive number).
ExceptionHugin
public int getDBNWindowOffset() throws ExceptionHugin
ExceptionHugin
public void initializeDBNWindow() throws ExceptionHugin
createDBNDomain
, and it must
have been triangulated using triangulateDBN
.
ExceptionHugin
public void computeDBNPredictions(int numberOfTimePoints) throws ExceptionHugin
numberOfTimePoints
time
slices beyond the current time window. This Domain must have
been produced by createDBNDomain
,
and it must have been triangulated using triangulateDBN
. The predictions are accessed using getPredictedBelief
, getPredictedMean
, getPredictedVariance
, and getPredictedValue
.
numberOfTimePoints
- the number of time slices to compute
predictions for (this must be a positive number).
ExceptionHugin
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |