Class BossTopK

java.lang.Object
edu.cmu.tetrad.algcomparison.algorithm.AbstractBootstrapAlgorithm
edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.BossTopK
All Implemented Interfaces:
Algorithm, LatentStructureAlgorithm, ReturnsBootstrapGraphs, TakesCovarianceMatrix, AcceptsKnowledge, HasParameters, TakesScoreWrapper, TetradSerializable, Serializable

BOSS-TopK (Best Order Score Search, Top K).

This is an algcomparison wrapper around BossTopK / PermutationSearchTopK. It runs the top-k BOSS search and returns the single top-scoring graph (so it behaves like the ordinary BOSS wrapper for comparison purposes). As a side effect it prints, to the console, each of the top permutations found (with its score), followed by each of their graphs. A later revision may return multiple graphs for display in the interface.

The number of models retained (topK), the split threshold (splitDelta), and the run cap (maxRuns) are read from the parameters with sensible defaults. Note that with splitDelta == 0 and numStarts == 1, only a single model is produced; to obtain several distinct models set splitDelta greater than 0 and/or use multiple restarts.

Version:
$Id: $Id
Author:
bryanandrews, josephramsey
See Also:
  • Constructor Details

    • BossTopK

      public BossTopK()
      Constructs a new BOSS-TopK algorithm.
    • BossTopK

      public BossTopK(ScoreWrapper score)
      Constructs a new BOSS-TopK algorithm with the given score.
      Parameters:
      score - the score to use
  • Method Details

    • getComparisonGraph

      public Graph getComparisonGraph(Graph graph)
      Returns that graph that the result should be compared to.

      Returns the true graph if there is one.

      Specified by:
      getComparisonGraph in interface Algorithm
      Parameters:
      graph - The true directed graph, if there is one.
      Returns:
      The comparison graph.
    • getDescription

      public String getDescription()
      Returns a short, one-line description of this algorithm. This will be printed in the report.

      Returns the description of the algorithm.

      Specified by:
      getDescription in interface Algorithm
      Returns:
      This description.
    • getDataType

      public DataType getDataType()
      Returns the data type that the search requires, whether continuous, discrete, or mixed.

      Returns the name of the algorithm.

      Specified by:
      getDataType in interface Algorithm
      Returns:
      This type.
    • getParameters

      public List<String> getParameters()
      Returns the list of parameter names that are used. These are looked up in ParamMap, so if they're not

      Returns the parameters for the algorithm.

      Specified by:
      getParameters in interface HasParameters
      Returns:
      Returns the list of parameter names that are used. These are looked up in ParamMap, so if they're not already defined they'll need to be defined there.
    • getScoreWrapper

      public ScoreWrapper getScoreWrapper()
      Returns the score wrapper.

      Returns the score wrapper.

      Specified by:
      getScoreWrapper in interface TakesScoreWrapper
      Returns:
      the score wrapper.
    • setScoreWrapper

      public void setScoreWrapper(ScoreWrapper score)
      Sets the score wrapper.

      Sets the score wrapper.

      Specified by:
      setScoreWrapper in interface TakesScoreWrapper
      Parameters:
      score - the score wrapper.
    • getKnowledge

      public Knowledge getKnowledge()
      Returns a knowledge object.

      Returns the knowledge.

      Specified by:
      getKnowledge in interface AcceptsKnowledge
      Returns:
      a knowledge object.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets a knowledge object.

      Sets the knowledge.

      Specified by:
      setKnowledge in interface AcceptsKnowledge
      Parameters:
      knowledge - a knowledge object.