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;
}
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;
}
Aggregations