Search in sources :

Example 1 with TreeNodeBitCondition

use of org.knime.base.node.mine.treeensemble2.model.TreeNodeBitCondition in project knime-core by knime.

the class BitSplitCandidate method getChildConditions.

/**
 * {@inheritDoc}
 */
@Override
public TreeNodeCondition[] getChildConditions() {
    TreeBitColumnMetaData metaData = getColumnData().getMetaData();
    TreeNodeCondition[] result = new TreeNodeCondition[2];
    result[0] = new TreeNodeBitCondition(metaData, true);
    result[1] = new TreeNodeBitCondition(metaData, false);
    return result;
}
Also used : TreeBitColumnMetaData(org.knime.base.node.mine.treeensemble2.data.TreeBitColumnMetaData) TreeNodeCondition(org.knime.base.node.mine.treeensemble2.model.TreeNodeCondition) TreeNodeBitCondition(org.knime.base.node.mine.treeensemble2.model.TreeNodeBitCondition)

Example 2 with TreeNodeBitCondition

use of org.knime.base.node.mine.treeensemble2.model.TreeNodeBitCondition in project knime-core by knime.

the class TreeBitVectorColumnData method updateChildMemberships.

/**
 * {@inheritDoc}
 */
@Override
public BitSet updateChildMemberships(final TreeNodeCondition childCondition, final DataMemberships parentMemberships) {
    TreeNodeBitCondition bitCondition = (TreeNodeBitCondition) childCondition;
    assert getMetaData().getAttributeName().equals(bitCondition.getColumnMetaData().getAttributeName());
    final boolean value = bitCondition.getValue();
    final ColumnMemberships columnMemberships = parentMemberships.getColumnMemberships(getMetaData().getAttributeIndex());
    BitSet inChild = new BitSet(columnMemberships.size());
    columnMemberships.reset();
    columnMemberships.next();
    for (int i = columnMemberships.getIndexInColumn(); ; i = columnMemberships.getIndexInColumn()) {
        if (m_columnBitSet.get(i) == value) {
            inChild.set(columnMemberships.getIndexInDataMemberships());
        }
        if (!columnMemberships.next()) {
            break;
        }
    }
    return inChild;
}
Also used : BitSet(java.util.BitSet) ColumnMemberships(org.knime.base.node.mine.treeensemble2.data.memberships.ColumnMemberships) TreeNodeBitCondition(org.knime.base.node.mine.treeensemble2.model.TreeNodeBitCondition)

Aggregations

TreeNodeBitCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeBitCondition)2 BitSet (java.util.BitSet)1 TreeBitColumnMetaData (org.knime.base.node.mine.treeensemble2.data.TreeBitColumnMetaData)1 ColumnMemberships (org.knime.base.node.mine.treeensemble2.data.memberships.ColumnMemberships)1 TreeNodeCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeCondition)1