Package edu.pitt.dbmi.algo.resampling
Class GeneralResamplingSearch
java.lang.Object
edu.pitt.dbmi.algo.resampling.GeneralResamplingSearch
A class for performing a general resampling search.
- Version:
- $Id: $Id
- Author:
- Chirayu Kong Wongchokprasitti, PhD (chw20@pitt.edu), josephramsey Cleanup.
-
Constructor Summary
ConstructorsConstructorDescriptionGeneralResamplingSearch
(DataSet data, Algorithm algorithm) Constructor for a single data set algorithm.GeneralResamplingSearch
(List<DataSet> dataSets, MultiDataSetAlgorithm algorithm) Constructor for a multi data set algorithm. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of algorithm runs that did not return a graph.search()
Performs the search and returns the list of graphs.void
setAddOriginalDataset
(boolean addOriginalDataset) Sets whether to add the original dataset as an additional sample.void
setAlgorithm
(Algorithm algorithm) Sets the algorithm, for single-data set algorithms.void
setBootstrappingNumThreads
(int bootstrappingNumThreads) Sets the number of threads to use for bootstrapping.void
Sets the data set, for single-data set algorithms.void
setIndependenceWrapper
(IndependenceWrapper independenceWrapper) Sets the independence test wrapper to pass to multi-data set algorithms.void
setKnowledge
(Knowledge knowledge) Sets the background knowledge to be used for the search.void
setMultiDataSetAlgorithm
(MultiDataSetAlgorithm multiDataSetAlgorithm) Sets the multi data set algorithm, for multi-data set algorithms.void
setNumberOfResamples
(int numberOfResamples) Sets the number of resamples to take.void
setOut
(PrintStream out) Sets the output stream that output (except for log output) should be sent to.void
setParameters
(Parameters parameters) Sets the parameters for the search.void
setPercentResampleSize
(double percentResampleSize) Sets the percentage of the resample size for each resampling.void
setResamplingWithReplacement
(boolean resamplingWithReplacement) Sets whether to resample with replacement.void
setScoreWrapper
(ScoreWrapper scoreWrapper) Sets the score wrapper to pass to multi-data set algorithms.void
setVerbose
(boolean verbose) Sets whether to print out verbose output.
-
Constructor Details
-
GeneralResamplingSearch
Constructor for a single data set algorithm.- Parameters:
data
- the data set.algorithm
- the algorithm.
-
GeneralResamplingSearch
Constructor for a multi data set algorithm.- Parameters:
dataSets
- the data sets.algorithm
- the algorithm.
-
-
Method Details
-
setAlgorithm
Sets the algorithm, for single-data set algorithms.- Parameters:
algorithm
- the algorithm.
-
setMultiDataSetAlgorithm
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
Sets the data set, for single-data set algorithms.- Parameters:
data
- the data set.
-
setKnowledge
Sets the background knowledge to be used for the search.- Parameters:
knowledge
- the knowledge object, specifying forbidden and required edges.
-
setOut
Sets the output stream that output (except for log output) should be sent to. By default, System.out.- Parameters:
out
- the output stream.
-
setParameters
Sets the parameters for the search.- Parameters:
parameters
- the parameters.
-
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
Sets the score wrapper to pass to multi-data set algorithms.- Parameters:
scoreWrapper
- the score wrapper.
-
setIndependenceWrapper
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.
-