- All Known Implementing Classes:
AbstractNode,CIMNode,CPTNode,DiscreteStateNode
public interface Node
Interface for a generic node of a PGM.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the parameters of the node were estimated.voidRemove the set of parents and children of the node.doubleReturns the local log-likelihood for the node.Returns the children of the node.getName()Returns the name of the node.intReturns the number of parents of the node.Returns the parents of the node.booleanSpecifies if the node has children.booleanSpecifies if the node has a class variable as parent.booleanSpecifies if the node has a class variable as spouse.booleanSpecifies if the node has parents.booleanSpecifies if the node is a class variable.voidisClassVariable(boolean isClassVariable) Defines if the node is a class variable.booleanSpecifies if the node is disconnected, i.e., it has neither parents or children.booleanSpecifies if the node is in the Markov blanket of at least one class variable.voidRemoves the parents and children of the node.voidremoveChild(Node childNode) Removes a certain child of the node.voidRemoves the children of the node.voidremoveParent(Node parentNode) Removes a certain parent of the node.voidRemoves the parents of the node.voidDefines a provided node as a child of this one.voidDefines a provided node as a parent of this one.voidEstablishes 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:
trueif the node has children,falseotherwise
-
hasClassVariableAsParent
boolean hasClassVariableAsParent()Specifies if the node has a class variable as parent.- Returns:
trueif the node has a class variable as parent,falseotherwise
-
hasClassVariableAsSpouse
boolean hasClassVariableAsSpouse()Specifies if the node has a class variable as spouse.- Returns:
trueif the node has a class variable as spouse,falseotherwise
-
hasParents
boolean hasParents()Specifies if the node has parents.- Returns:
trueif the node has parents,falseotherwise
-
isClassVariable
void isClassVariable(boolean isClassVariable) Defines if the node is a class variable.- Parameters:
isClassVariable-trueif the node is a class variable,falseotherwise
-
isClassVariable
boolean isClassVariable()Specifies if the node is a class variable.- Returns:
trueif the node is a class variable,falseotherwise
-
isDisconnected
boolean isDisconnected()Specifies if the node is disconnected, i.e., it has neither parents or children.- Returns:
trueif the node is disconnected,falseotherwise
-
isInMarkovBlanketClassVariable
boolean isInMarkovBlanketClassVariable()Specifies if the node is in the Markov blanket of at least one class variable.- Returns:
trueif the node is in the Markov blanket of a class variable,falseotherwise
-
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
-