Module es.upm.fi.cig.multictbnc
Class NaiveBayes
java.lang.Object
es.upm.fi.cig.multictbnc.learning.structure.constraints.AbstractStructureConstraints
es.upm.fi.cig.multictbnc.learning.structure.constraints.CTBNC.NaiveBayes
- All Implemented Interfaces:
StructureConstraints
Defines the structure of a continuous-time Naive Bayes classifier. As it is used for the construction of
Multi-CTBNCs, the existence of more than one class variable is allowed.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initialiseStructure
(PGM<? extends Node> pgm) The structure of the PGM is initialised.boolean
isStructureLegal
(boolean[][] adjacencyMatrix, NodeIndexer<? extends Node> nodeIndexer) Determines if the structure of a PGM is legal.boolean
Determines if there is only one possible structure.
-
Constructor Details
-
NaiveBayes
public NaiveBayes()
-
-
Method Details
-
initialiseStructure
Description copied from interface:StructureConstraints
The structure of the PGM is initialised. This method is necessary for models such as naive Bayes.- Specified by:
initialiseStructure
in interfaceStructureConstraints
- Overrides:
initialiseStructure
in classAbstractStructureConstraints
- Parameters:
pgm
- probabilistic graphical model
-
uniqueStructure
public boolean uniqueStructure()Description copied from interface:StructureConstraints
Determines if there is only one possible structure. This is the case of models such as naive Bayes, for which it is not necessary to find a structure.- Specified by:
uniqueStructure
in interfaceStructureConstraints
- Overrides:
uniqueStructure
in classAbstractStructureConstraints
- Returns:
- true if there is only one possible structure, false otherwise
-
isStructureLegal
public boolean isStructureLegal(boolean[][] adjacencyMatrix, NodeIndexer<? extends Node> nodeIndexer) Description copied from interface:StructureConstraints
Determines if the structure of a PGM is legal.- Parameters:
adjacencyMatrix
- adjacency matrixnodeIndexer
- node indexer that allows access to information about the nodes- Returns:
- true if the structure is legal, false otherwise
-