- All Known Implementing Classes:
AbstractNode
,CIMNode
,CPTNode
,DiscreteStateNode
public interface Node
Interface for a generic node of a PGM.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the parameters of the node were estimated.void
Remove the set of parents and children of the node.double
Returns the local log-likelihood for the node.Returns the children of the node.getName()
Returns the name of the node.int
Returns the number of parents of the node.Returns the parents of the node.boolean
Specifies if the node has children.boolean
Specifies if the node has a class variable as parent.boolean
Specifies if the node has a class variable as spouse.boolean
Specifies if the node has parents.boolean
Specifies if the node is a class variable.void
isClassVariable
(boolean isClassVariable) Defines if the node is a class variable.boolean
Specifies if the node is disconnected, i.e., it has neither parents or children.boolean
Specifies if the node is in the Markov blanket of at least one class variable.void
Removes the parents and children of the node.void
removeChild
(Node childNode) Removes a certain child of the node.void
Removes the children of the node.void
removeParent
(Node parentNode) Removes a certain parent of the node.void
Removes the parents of the node.void
Defines a provided node as a child of this one.void
Defines a provided node as a parent of this one.void
Establishes the sufficient statistics of the node.
-
Method Details
-
areParametersEstimated
boolean areParametersEstimated()Returns true if the parameters of the node were estimated.- Returns:
- true if the parameters of the node were estimated, false otherwise
-
clearParentAndChildrenSets
void clearParentAndChildrenSets()Remove the set of parents and children of the node. This method should be used with caution, as references to this node from others will not be affected. It is recommended its use when creating an empty PGM, i.e., we are removing all edges between nodes. -
estimateLogLikelihood
double estimateLogLikelihood()Returns the local log-likelihood for the node.- Returns:
- local log-likelihood
-
getChildren
Returns the children of the node.- Returns:
- child node list
-
getName
String getName()Returns the name of the node.- Returns:
- node name
-
getNumParents
int getNumParents()Returns the number of parents of the node.- Returns:
- parent node list
-
getParents
Returns the parents of the node.- Returns:
- parent node list
-
hasChildren
boolean hasChildren()Specifies if the node has children.- Returns:
true
if the node has children,false
otherwise
-
hasClassVariableAsParent
boolean hasClassVariableAsParent()Specifies if the node has a class variable as parent.- Returns:
true
if the node has a class variable as parent,false
otherwise
-
hasClassVariableAsSpouse
boolean hasClassVariableAsSpouse()Specifies if the node has a class variable as spouse.- Returns:
true
if the node has a class variable as spouse,false
otherwise
-
hasParents
boolean hasParents()Specifies if the node has parents.- Returns:
true
if the node has parents,false
otherwise
-
isClassVariable
void isClassVariable(boolean isClassVariable) Defines if the node is a class variable.- Parameters:
isClassVariable
-true
if the node is a class variable,false
otherwise
-
isClassVariable
boolean isClassVariable()Specifies if the node is a class variable.- Returns:
true
if the node is a class variable,false
otherwise
-
isDisconnected
boolean isDisconnected()Specifies if the node is disconnected, i.e., it has neither parents or children.- Returns:
true
if the node is disconnected,false
otherwise
-
isInMarkovBlanketClassVariable
boolean isInMarkovBlanketClassVariable()Specifies if the node is in the Markov blanket of at least one class variable.- Returns:
true
if the node is in the Markov blanket of a class variable,false
otherwise
-
removeAllEdges
void removeAllEdges()Removes the parents and children of the node. -
removeChild
Removes a certain child of the node.- Parameters:
childNode
- child node
-
removeChildren
void removeChildren()Removes the children of the node. -
removeParent
Removes a certain parent of the node.- Parameters:
parentNode
- parent node
-
removeParents
void removeParents()Removes the parents of the node. -
setChild
Defines a provided node as a child of this one.- Parameters:
childNode
- child node
-
setParent
Defines a provided node as a parent of this one.- Parameters:
parentNode
- parent node
-
setSufficientStatistics
Establishes the sufficient statistics of the node.- Parameters:
ss
- sufficient statistics
-