Class GeneralResamplingSearch

java.lang.Object
edu.pitt.dbmi.algo.resampling.GeneralResamplingSearch

public class GeneralResamplingSearch extends Object
A class for performing a general resampling search.
Version:
$Id: $Id
Author:
Chirayu Kong Wongchokprasitti, PhD (chw20@pitt.edu), josephramsey Cleanup.
  • Constructor Details

    • GeneralResamplingSearch

      public GeneralResamplingSearch(DataSet data, Algorithm algorithm)
      Constructor for a single data set algorithm.
      Parameters:
      data - the data set.
      algorithm - the algorithm.
    • GeneralResamplingSearch

      public GeneralResamplingSearch(List<DataSet> dataSets, MultiDataSetAlgorithm algorithm)
      Constructor for a multi data set algorithm.
      Parameters:
      dataSets - the data sets.
      algorithm - the algorithm.
  • Method Details

    • setAlgorithm

      public void setAlgorithm(Algorithm algorithm)
      Sets the algorithm, for single-data set algorithms.
      Parameters:
      algorithm - the algorithm.
    • setMultiDataSetAlgorithm

      public void setMultiDataSetAlgorithm(MultiDataSetAlgorithm multiDataSetAlgorithm)
      Sets the multi data set algorithm, for multi-data set algorithms.
      Parameters:
      multiDataSetAlgorithm - the multi data set algorithm.
    • setPercentResampleSize

      public void setPercentResampleSize(double percentResampleSize)
      Sets the percentage of the resample size for each resampling.
      Parameters:
      percentResampleSize - the resampling size, from 0 to 100.
    • setResamplingWithReplacement

      public void setResamplingWithReplacement(boolean resamplingWithReplacement)
      Sets whether to resample with replacement.
      Parameters:
      resamplingWithReplacement - whether to resample with replacement.
    • setAddOriginalDataset

      public void setAddOriginalDataset(boolean addOriginalDataset)
      Sets whether to add the original dataset as an additional sample.
      Parameters:
      addOriginalDataset - whether to add the original dataset as an additional sample.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether to print out verbose output.
      Parameters:
      verbose - whether to print out verbose output.
    • setData

      public void setData(DataSet data)
      Sets the data set, for single-data set algorithms.
      Parameters:
      data - the data set.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the background knowledge to be used for the search.
      Parameters:
      knowledge - the knowledge object, specifying forbidden and required edges.
    • setOut

      public void setOut(PrintStream out)
      Sets the output stream that output (except for log output) should be sent to. By default, System.out.
      Parameters:
      out - the output stream.
    • setParameters

      public void setParameters(Parameters parameters)
      Sets the parameters for the search.
      Parameters:
      parameters - the parameters.
    • search

      public List<Graph> search()
      Performs the search and returns the list of graphs.
      Returns:
      the list of graphs. Some of these may be null if the search algorithm did not return a graph.
    • getNumRunsReturningNullGraph

      public int getNumRunsReturningNullGraph()
      Returns the number of algorithm runs that did not return a graph.
      Returns:
      the number of algorithms runs that did not return a graph.
    • setScoreWrapper

      public void setScoreWrapper(ScoreWrapper scoreWrapper)
      Sets the score wrapper to pass to multi-data set algorithms.
      Parameters:
      scoreWrapper - the score wrapper.
    • setIndependenceWrapper

      public void setIndependenceWrapper(IndependenceWrapper independenceWrapper)
      Sets the independence test wrapper to pass to multi-data set algorithms.
      Parameters:
      independenceWrapper - the independence test wrapper.
    • setBootstrappingNumThreads

      public void setBootstrappingNumThreads(int bootstrappingNumThreads)
      Sets the number of threads to use for bootstrapping. Must be at least one. Note that this is the number of threads used for the bootstrapping itself, not the number of threads used for each search; the latter is determined by the individual search algorithm.
      Parameters:
      bootstrappingNumThreads - the number of threads to use for bootstrapping.
    • setNumberOfResamples

      public void setNumberOfResamples(int numberOfResamples)
      Sets the number of resamples to take. Must be at least one. Note that in the interface, the number of resamples can be zero; this zero value indicates that bootstrapping should not be performed, so a GeneralResamplingSearch should not be constructed in this case.
      Parameters:
      numberOfResamples - the number of resamples to take.