Package weka.classifiers.bayes.net
Class ParentSet
java.lang.Object
weka.classifiers.bayes.net.ParentSet
- All Implemented Interfaces:
Serializable
,RevisionHandler
Helper class for Bayes Network classifiers. Provides datastructures to
represent a set of parents in a graph.
- Version:
- $Revision: 8034 $
- Author:
- Remco Bouckaert (rrb@xm.co.nz)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add parent to parent set at specific location and update internals (specifically the cardinality of the parent set)void
Add parent to parent set and update internals (specifically the cardinality of the parent set)boolean
contains
(int iNode) test if node is contained in parent setvoid
Copy makes current parents set equal to other parent setvoid
deleteLastParent
(Instances _Instances) Delete last added parent from parent set and update internals (specifically the cardinality of the parent set)int
deleteParent
(int nParent, Instances _Instances) delete node from parent setint
returns cardinality of parentsint
getFreshCardinalityOfParents
(Instances _Instances) returns cardinality of parents after recalculationint
returns number of parentsint
getParent
(int iParent) returns index parent of parent specified by indexint[]
Returns the revision string.void
maxParentSetSize
(int nSize) reserve memory for parent setvoid
SetParent
(int iParent, int nNode) sets index parent of parent specified by index
-
Constructor Details
-
ParentSet
public ParentSet()default constructor -
ParentSet
public ParentSet(int nMaxNrOfParents) constructor- Parameters:
nMaxNrOfParents
- upper bound on nr of parents
-
ParentSet
copy constructor- Parameters:
other
- other parent set
-
-
Method Details
-
getParent
public int getParent(int iParent) returns index parent of parent specified by index- Parameters:
iParent
- Index of parent- Returns:
- index of parent
-
getParents
public int[] getParents() -
SetParent
public void SetParent(int iParent, int nNode) sets index parent of parent specified by index- Parameters:
iParent
- Index of parentnNode
- index of the node that becomes parent
-
getNrOfParents
public int getNrOfParents()returns number of parents- Returns:
- number of parents
-
contains
public boolean contains(int iNode) test if node is contained in parent set- Parameters:
iNode
- node to test for- Returns:
- number of parents
-
getCardinalityOfParents
public int getCardinalityOfParents()returns cardinality of parents- Returns:
- the cardinality
-
getFreshCardinalityOfParents
returns cardinality of parents after recalculation- Returns:
- the cardinality
-
maxParentSetSize
public void maxParentSetSize(int nSize) reserve memory for parent set- Parameters:
nSize
- maximum size of parent set to reserver memory for
-
addParent
Add parent to parent set and update internals (specifically the cardinality of the parent set)- Parameters:
nParent
- parent to add_Instances
- used for updating the internals
-
addParent
Add parent to parent set at specific location and update internals (specifically the cardinality of the parent set)- Parameters:
nParent
- parent to addiParent
- location to add parent in parent set_Instances
- used for updating the internals
-
deleteParent
delete node from parent set- Parameters:
nParent
- node number of the parent to delete_Instances
- data set- Returns:
- location of the parent in the parent set. This information can be used to restore the parent set using the addParent method.
-
deleteLastParent
Delete last added parent from parent set and update internals (specifically the cardinality of the parent set)- Parameters:
_Instances
- used for updating the internals
-
copy
Copy makes current parents set equal to other parent set- Parameters:
other
- : parent set to make a copy from
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-