Search in sources :

Example 1 with MimRunner

use of edu.cmu.tetradapp.model.MimRunner in project tetrad by cmu-phil.

the class MimbuildEditor method getIndTestParamBox.

/**
 * Factory to return the correct param editor for independence test params.
 * This will go in a little box in the search editor.
 */
private JComponent getIndTestParamBox(Parameters params) {
    if (params == null) {
        throw new NullPointerException();
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        DataModel dataModel = runner.getData();
        if (dataModel instanceof DataSet) {
            DataSet data = (DataSet) runner.getData();
            boolean discrete = data.isDiscrete();
            return new BuildPureClustersIndTestParamsEditor2(params, discrete);
        } else if (dataModel instanceof ICovarianceMatrix) {
            return new BuildPureClustersIndTestParamsEditor2(params, false);
        }
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        boolean discreteData = false;
        if (runner.getData() instanceof DataSet) {
            discreteData = ((DataSet) runner.getData()).isDiscrete();
        }
        return new PurifyIndTestParamsEditor(params, discreteData);
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        return new MimBuildIndTestParamsEditor(params);
    }
    throw new IllegalArgumentException("Unrecognized Parameters: " + params.getClass());
}
Also used : Parameters(edu.cmu.tetrad.util.Parameters) DataSet(edu.cmu.tetrad.data.DataSet) DataModel(edu.cmu.tetrad.data.DataModel) ICovarianceMatrix(edu.cmu.tetrad.data.ICovarianceMatrix) MimRunner(edu.cmu.tetradapp.model.MimRunner)

Example 2 with MimRunner

use of edu.cmu.tetradapp.model.MimRunner in project tetrad by cmu-phil.

the class MimSearchEditor2 method getIndTestParamBox.

/**
 * Factory to return the correct param editor for independence test params.
 * This will go in a little box in the search editor.
 */
private JComponent getIndTestParamBox(Parameters params) {
    if (params == null) {
        throw new NullPointerException();
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        DataModel dataModel = runner.getData();
        if (dataModel instanceof DataSet) {
            DataSet data = (DataSet) runner.getData();
            boolean discrete = data.isDiscrete();
            return new BuildPureClustersIndTestParamsEditor2(params, discrete);
        } else if (dataModel instanceof ICovarianceMatrix) {
            return new BuildPureClustersIndTestParamsEditor2(params, false);
        }
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        boolean discreteData = false;
        if (runner.getData() instanceof DataSet) {
            discreteData = ((DataSet) runner.getData()).isDiscrete();
        }
        return new PurifyIndTestParamsEditor(params, discreteData);
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        return new MimBuildIndTestParamsEditor(params);
    }
    throw new IllegalArgumentException("Unrecognized Parameters: " + params.getClass());
}
Also used : Parameters(edu.cmu.tetrad.util.Parameters) DataSet(edu.cmu.tetrad.data.DataSet) DataModel(edu.cmu.tetrad.data.DataModel) ICovarianceMatrix(edu.cmu.tetrad.data.ICovarianceMatrix) MimRunner(edu.cmu.tetradapp.model.MimRunner)

Example 3 with MimRunner

use of edu.cmu.tetradapp.model.MimRunner in project tetrad by cmu-phil.

the class MimSearchEditor method getIndTestParamBox.

/**
 * Factory to return the correct param editor for independence test params.
 * This will go in a little box in the search editor.
 */
private JComponent getIndTestParamBox(Parameters params) {
    if (params == null) {
        throw new NullPointerException();
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        DataModel dataModel = runner.getData();
        if (dataModel instanceof DataSet) {
            DataSet data = (DataSet) runner.getData();
            boolean discrete = data.isDiscrete();
            return new BuildPureClustersIndTestParamsEditor(params, discrete);
        } else if (dataModel instanceof ICovarianceMatrix) {
            return new BuildPureClustersIndTestParamsEditor(params, false);
        }
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        boolean discreteData = false;
        if (runner.getData() instanceof DataSet) {
            discreteData = ((DataSet) runner.getData()).isDiscrete();
        }
        return new PurifyIndTestParamsEditor(params, discreteData);
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        return new MimBuildIndTestParamsEditor(params);
    }
    throw new IllegalArgumentException("Unrecognized IndTestParams: " + params.getClass());
}
Also used : Parameters(edu.cmu.tetrad.util.Parameters) DataSet(edu.cmu.tetrad.data.DataSet) DataModel(edu.cmu.tetrad.data.DataModel) ICovarianceMatrix(edu.cmu.tetrad.data.ICovarianceMatrix) MimRunner(edu.cmu.tetradapp.model.MimRunner)

Example 4 with MimRunner

use of edu.cmu.tetradapp.model.MimRunner in project tetrad by cmu-phil.

the class FofcSearchEditor method getIndTestParamBox.

/**
 * Factory to return the correct param editor for independence test params.
 * This will go in a little box in the search editor.
 */
private JComponent getIndTestParamBox(Parameters params) {
    if (params == null) {
        throw new NullPointerException();
    }
    if (params instanceof Parameters) {
        MimRunner runner = getMimRunner();
        params.set("varNames", runner.getParams().get("varNames", null));
        return new FofcIndTestParamsEditor(params);
    }
    throw new IllegalArgumentException("Unrecognized Parameters: " + params.getClass());
}
Also used : Parameters(edu.cmu.tetrad.util.Parameters) MimRunner(edu.cmu.tetradapp.model.MimRunner)

Example 5 with MimRunner

use of edu.cmu.tetradapp.model.MimRunner in project tetrad by cmu-phil.

the class FtfcSearchEditor method getIndTestParamBox.

/**
 * Factory to return the correct param editor for independence test params.
 * This will go in a little box in the search editor.
 */
private JComponent getIndTestParamBox(Parameters params) {
    if (params == null) {
        throw new NullPointerException();
    }
    MimRunner runner = getMimRunner();
    params.set("varNames", runner.getParams().get("varNames", null));
    return new FtfcIndTestParamsEditor(params);
}
Also used : MimRunner(edu.cmu.tetradapp.model.MimRunner)

Aggregations

MimRunner (edu.cmu.tetradapp.model.MimRunner)5 Parameters (edu.cmu.tetrad.util.Parameters)4 DataModel (edu.cmu.tetrad.data.DataModel)3 DataSet (edu.cmu.tetrad.data.DataSet)3 ICovarianceMatrix (edu.cmu.tetrad.data.ICovarianceMatrix)3