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
ConstructorDescriptionBNHillClimbingHybridAlgorithm
(BNScoreFunction scoreFunction, boolean[][] skeletonAdjacencyMatrix) Initialises the algorithm by proving a score function and a skeleton of the Bayesian network. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
findBestNeighbor
(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:HillClimbingImplementation
Finds a structure for a given PGM.- Specified by:
findStructure
in interfaceHillClimbingImplementation
- Overrides:
findStructure
in 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:BNHillClimbing
Finds the best neighbour of the adjacency matrix "bestStructure" given an operation to perform (addition, deletion or reversal of arcs).- Overrides:
findBestNeighbor
in classBNHillClimbing
- Parameters:
bn
- Bayesian network whose structure is being learntbestSolution
- best structure so farscores
- two-dimensionaldouble
array containing the structure scores after applying each of the possible operations over the adjacency matrixadjacencyMatrices
- three-dimensionalboolean
array containing the resulting adjacency matrices after applying each of the possible operations over the original matrixoperation
- operation to perform over the adjacency matrix
-