Search in sources :

Example 66 with BootstrapEdgeEnsemble

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();
    }
}
Also used : GeneralBootstrapTest(edu.pitt.dbmi.algo.bootstrap.GeneralBootstrapTest) BootstrapEdgeEnsemble(edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble) DataSet(edu.cmu.tetrad.data.DataSet)

Aggregations

BootstrapEdgeEnsemble (edu.pitt.dbmi.algo.bootstrap.BootstrapEdgeEnsemble)66 GeneralBootstrapTest (edu.pitt.dbmi.algo.bootstrap.GeneralBootstrapTest)66 DataSet (edu.cmu.tetrad.data.DataSet)26 ArrayList (java.util.ArrayList)21 EdgeListGraph (edu.cmu.tetrad.graph.EdgeListGraph)15 Graph (edu.cmu.tetrad.graph.Graph)15 TakesInitialGraph (edu.cmu.tetrad.algcomparison.utils.TakesInitialGraph)10 Lofs2 (edu.cmu.tetrad.search.Lofs2)10 Node (edu.cmu.tetrad.graph.Node)6 PrintStream (java.io.PrintStream)6 PcAll (edu.cmu.tetrad.search.PcAll)5 edu.cmu.tetrad.search (edu.cmu.tetrad.search)4 IndTestScore (edu.cmu.tetrad.search.IndTestScore)4 IndependenceTest (edu.cmu.tetrad.search.IndependenceTest)4 Fges (edu.cmu.tetrad.search.Fges)3 Score (edu.cmu.tetrad.search.Score)3 Fges (edu.cmu.tetrad.algcomparison.algorithm.oracle.pattern.Fges)2 PcStableMax (edu.cmu.tetrad.search.PcStableMax)2 SemBicScoreDeterministic (edu.cmu.tetrad.search.SemBicScoreDeterministic)2 SemBicScoreImages (edu.cmu.tetrad.search.SemBicScoreImages)2