use of edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble in project tetrad by cmu-phil.
the class FaskConcatenated method search.
@Override
public Graph search(DataModel dataSet, Parameters parameters) {
if (!parameters.getBoolean("bootstrapping")) {
return search(Collections.singletonList((DataModel) DataUtils.getContinuousDataSet(dataSet)), parameters);
} else {
FaskConcatenated algorithm = new FaskConcatenated(score);
algorithm.setKnowledge(knowledge);
List<DataSet> dataSets = Collections.singletonList(DataUtils.getContinuousDataSet(dataSet));
GeneralBootstrapTest search = new GeneralBootstrapTest(dataSets, algorithm, parameters.getInt("bootstrapSampleSize"));
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();
}
}
use of edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble in project tetrad by cmu-phil.
the class FaskConcatenated method search.
@Override
public Graph search(List<DataModel> dataSets, Parameters parameters) {
if (parameters.getInt("bootstrapSampleSize") < 1) {
List<DataSet> centered = new ArrayList<>();
for (DataModel dataSet : dataSets) {
centered.add(DataUtils.standardizeData((DataSet) dataSet));
}
DataSet dataSet = DataUtils.concatenate(centered);
dataSet.setNumberFormat(new DecimalFormat("0.000000000000000000"));
Fask search = new Fask(dataSet, score.getScore(dataSet, parameters));
search.setDepth(parameters.getInt("depth"));
search.setPenaltyDiscount(parameters.getDouble("penaltyDiscount"));
search.setExtraEdgeThreshold(parameters.getDouble("extraEdgeThreshold"));
search.setDelta(parameters.getDouble("faskDelta"));
search.setAlpha(parameters.getDouble("twoCycleAlpha"));
search.setKnowledge(knowledge);
return search.search();
} else {
FaskConcatenated algorithm = new FaskConcatenated(score);
algorithm.setKnowledge(knowledge);
List<DataSet> datasets = new ArrayList<>();
for (DataModel dataModel : dataSets) {
datasets.add((DataSet) dataModel);
}
GeneralBootstrapTest search = new GeneralBootstrapTest(datasets, algorithm, parameters.getInt("bootstrapSampleSize"));
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();
}
}
use of edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble in project tetrad by cmu-phil.
the class ImagesBDeu method search.
@Override
public Graph search(DataModel dataSet, Parameters parameters) {
if (!parameters.getBoolean("bootstrapping")) {
return search(Collections.singletonList((DataModel) DataUtils.getDiscreteDataSet(dataSet)), parameters);
} else {
ImagesBDeu imagesBDeu = new ImagesBDeu();
imagesBDeu.setKnowledge(knowledge);
List<DataSet> dataSets = Collections.singletonList(DataUtils.getContinuousDataSet(dataSet));
GeneralBootstrapTest search = new GeneralBootstrapTest(dataSets, imagesBDeu, parameters.getInt("bootstrapSampleSize"));
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();
}
}
use of edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble in project tetrad by cmu-phil.
the class ImagesBDeu method search.
@Override
public Graph search(List<DataModel> dataSets, Parameters parameters) {
if (parameters.getInt("bootstrapSampleSize") < 1) {
BdeuScoreImages score = new BdeuScoreImages(dataSets);
score.setSamplePrior(parameters.getDouble("samplePrior"));
score.setStructurePrior(parameters.getDouble("structurePrior"));
edu.cmu.tetrad.search.Fges search = new edu.cmu.tetrad.search.Fges(score);
search.setFaithfulnessAssumed(true);
search.setKnowledge(knowledge);
return search.search();
} else {
ImagesBDeu imagesBDeu = new ImagesBDeu();
// imagesBDeu.setKnowledge(knowledge);
List<DataSet> datasets = new ArrayList<>();
for (DataModel dataModel : dataSets) {
datasets.add((DataSet) dataModel);
}
GeneralBootstrapTest search = new GeneralBootstrapTest(datasets, imagesBDeu, 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();
}
}
use of edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble in project tetrad by cmu-phil.
the class ImagesPcStableMax method search.
@Override
public Graph search(DataModel dataSet, Parameters parameters) {
if (!parameters.getBoolean("bootstrapping")) {
return search(Collections.singletonList((DataModel) DataUtils.getContinuousDataSet(dataSet)), parameters);
} else {
ImagesPcStableMax imagesPcStableMax = new ImagesPcStableMax();
imagesPcStableMax.setKnowledge(knowledge);
List<DataSet> dataSets = Collections.singletonList(DataUtils.getContinuousDataSet(dataSet));
GeneralBootstrapTest search = new GeneralBootstrapTest(dataSets, imagesPcStableMax, parameters.getInt("bootstrapSampleSize"));
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