Module es.upm.fi.cig.multictbnc
Class BNHillClimbingHybridAlgorithm
java.lang.Object
es.upm.fi.cig.multictbnc.learning.structure.optimisation.hillclimbing.implementation.BNHillClimbing
es.upm.fi.cig.multictbnc.learning.structure.hybrid.hillclimbing.BNHillClimbingHybridAlgorithm
- All Implemented Interfaces:
HillClimbingImplementation
Implements the maximisation phase (hill climbing algorithm) of the hybrid structure learning algorithm for Bayesian
networks.
-
Constructor Summary
ConstructorsConstructorDescriptionBNHillClimbingHybridAlgorithm(BNScoreFunction scoreFunction, boolean[][] skeletonAdjacencyMatrix) Initialises the algorithm by proving a score function and a skeleton of the Bayesian network. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfindBestNeighbor(BN<? extends Node> bn, HillClimbingSolution bestSolution, double[] scores, boolean[][][] adjacencyMatrices, String operation) Finds the best neighbour of the adjacency matrix "bestStructure" given an operation to perform (addition, deletion or reversal of arcs).findStructure(PGM<? extends Node> pgm) Finds a structure for a given PGM.Methods inherited from class es.upm.fi.cig.multictbnc.learning.structure.optimisation.hillclimbing.implementation.BNHillClimbing
computeScore, findStructure, findStructure, getIdentifier, getInfoScoreFunction, getNumEdgesTested, getParametersAlgorithm, increaseNumEdgesTested, isScoreImproved, resetNumEdgesTested
-
Constructor Details
-
BNHillClimbingHybridAlgorithm
public BNHillClimbingHybridAlgorithm(BNScoreFunction scoreFunction, boolean[][] skeletonAdjacencyMatrix) Initialises the algorithm by proving a score function and a skeleton of the Bayesian network.- Parameters:
scoreFunction- score functionskeletonAdjacencyMatrix- adjacency matrix of the Bayesian network skeleton
-
-
Method Details
-
findStructure
Description copied from interface:HillClimbingImplementationFinds a structure for a given PGM.- Specified by:
findStructurein interfaceHillClimbingImplementation- Overrides:
findStructurein classBNHillClimbing- Parameters:
pgm- a probabilistic graphical model- Returns:
- solution given by the hill climbing algorithm
-
findBestNeighbor
protected void findBestNeighbor(BN<? extends Node> bn, HillClimbingSolution bestSolution, double[] scores, boolean[][][] adjacencyMatrices, String operation) Description copied from class:BNHillClimbingFinds the best neighbour of the adjacency matrix "bestStructure" given an operation to perform (addition, deletion or reversal of arcs).- Overrides:
findBestNeighborin classBNHillClimbing- Parameters:
bn- Bayesian network whose structure is being learntbestSolution- best structure so farscores- two-dimensionaldoublearray containing the structure scores after applying each of the possible operations over the adjacency matrixadjacencyMatrices- three-dimensionalbooleanarray containing the resulting adjacency matrices after applying each of the possible operations over the original matrixoperation- operation to perform over the adjacency matrix
-