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

public class BNHillClimbingHybridAlgorithm extends BNHillClimbing
Implements the maximisation phase (hill climbing algorithm) of the hybrid structure learning algorithm for Bayesian networks.
  • 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 function
      skeletonAdjacencyMatrix - adjacency matrix of the Bayesian network skeleton
  • Method Details

    • findStructure

      public HillClimbingSolution findStructure(PGM<? extends Node> pgm)
      Description copied from interface: HillClimbingImplementation
      Finds a structure for a given PGM.
      Specified by:
      findStructure in interface HillClimbingImplementation
      Overrides:
      findStructure in class BNHillClimbing
      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 class BNHillClimbing
      Parameters:
      bn - Bayesian network whose structure is being learnt
      bestSolution - best structure so far
      scores - two-dimensional double array containing the structure scores after applying each of the possible operations over the adjacency matrix
      adjacencyMatrices - three-dimensional boolean array containing the resulting adjacency matrices after applying each of the possible operations over the original matrix
      operation - operation to perform over the adjacency matrix