Search in sources :

Example 1 with TreeTargetColumnData

use of org.knime.base.node.mine.treeensemble2.data.TreeTargetColumnData in project knime-core by knime.

the class AbstractColumnSampleTest method createTreeData.

/**
 * @return TreeData object for testing purposes
 */
protected static TreeData createTreeData() {
    final TestDataGenerator dataGen = new TestDataGenerator(new TreeEnsembleLearnerConfiguration(false));
    final TreeAttributeColumnData[] cols = new TreeAttributeColumnData[10];
    for (int i = 0; i < TREE_DATA_SIZE; i++) {
        if (i % 2 == 0) {
            cols[i] = dataGen.createNominalAttributeColumn("a, b", "nom" + i, i);
        } else {
            cols[i] = dataGen.createNumericAttributeColumn("1, 2", "num1", i);
        }
    }
    TreeTargetColumnData target = TestDataGenerator.createNominalTargetColumn("A, B");
    return dataGen.createTreeData(target, cols);
}
Also used : TreeEnsembleLearnerConfiguration(org.knime.base.node.mine.treeensemble2.node.learner.TreeEnsembleLearnerConfiguration) TreeAttributeColumnData(org.knime.base.node.mine.treeensemble2.data.TreeAttributeColumnData) TreeTargetColumnData(org.knime.base.node.mine.treeensemble2.data.TreeTargetColumnData) TestDataGenerator(org.knime.base.node.mine.treeensemble2.data.TestDataGenerator)

Aggregations

TestDataGenerator (org.knime.base.node.mine.treeensemble2.data.TestDataGenerator)1 TreeAttributeColumnData (org.knime.base.node.mine.treeensemble2.data.TreeAttributeColumnData)1 TreeTargetColumnData (org.knime.base.node.mine.treeensemble2.data.TreeTargetColumnData)1 TreeEnsembleLearnerConfiguration (org.knime.base.node.mine.treeensemble2.node.learner.TreeEnsembleLearnerConfiguration)1