use of edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble in project tetrad by cmu-phil.
the class Fci method search.
@Override
public Graph search(DataModel dataSet, Parameters parameters) {
if (parameters.getInt("bootstrapSampleSize") < 1) {
if (algorithm != null) {
initialGraph = algorithm.search(dataSet, parameters);
}
edu.cmu.tetrad.search.Fci search = new edu.cmu.tetrad.search.Fci(test.getTest(dataSet, parameters));
search.setDepth(parameters.getInt("depth"));
search.setKnowledge(knowledge);
search.setMaxPathLength(parameters.getInt("maxPathLength"));
search.setCompleteRuleSetUsed(parameters.getBoolean("completeRuleSetUsed"));
// }
return search.search();
} else {
Fci algorithm = new Fci(test);
// algorithm.setKnowledge(knowledge);
// if (initialGraph != null) {
// algorithm.setInitialGraph(initialGraph);
// }
DataSet data = (DataSet) dataSet;
GeneralBootstrapTest search = new GeneralBootstrapTest(data, algorithm, parameters.getInt("bootstrapSampleSize"));
search.setKnowledge(knowledge);
BootstrapEdgeEnsemble edgeEnsemble = BootstrapEdgeEnsemble.Highest;
switch(parameters.getInt("bootstrapEnsemble", 1)) {
case 0:
edgeEnsemble = BootstrapEdgeEnsemble.Preserved;
break;
case 1:
edgeEnsemble = BootstrapEdgeEnsemble.Highest;
break;
case 2:
edgeEnsemble = BootstrapEdgeEnsemble.Majority;
}
search.setEdgeEnsemble(edgeEnsemble);
search.setParameters(parameters);
search.setVerbose(parameters.getBoolean("verbose"));
return search.search();
}
}
Aggregations