Search in sources :

Example 1 with TreeAttributeColumnMetaData

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

the class AbstractGradientBoostingLearner method createPredictorRecord.

/**
 * Creates a PredictorRecord from the inMemory TreeData object
 *
 * @param data
 * @param indexManager
 * @param rowIdx
 * @return a PredictorRecord for the row at <b>rowIdx</b> in <b>data</b>
 */
public static PredictorRecord createPredictorRecord(final TreeData data, final IDataIndexManager indexManager, final int rowIdx) {
    Map<String, Object> valMap = new HashMap<String, Object>();
    for (TreeAttributeColumnData column : data.getColumns()) {
        TreeAttributeColumnMetaData meta = column.getMetaData();
        valMap.put(meta.getAttributeName(), handleMissingValues(column.getValueAt(indexManager.getPositionsInColumn(meta.getAttributeIndex())[rowIdx]), column));
    }
    return new PredictorRecord(valMap);
}
Also used : TreeAttributeColumnData(org.knime.base.node.mine.treeensemble2.data.TreeAttributeColumnData) HashMap(java.util.HashMap) PredictorRecord(org.knime.base.node.mine.treeensemble2.data.PredictorRecord) TreeAttributeColumnMetaData(org.knime.base.node.mine.treeensemble2.data.TreeAttributeColumnMetaData)

Aggregations

HashMap (java.util.HashMap)1 PredictorRecord (org.knime.base.node.mine.treeensemble2.data.PredictorRecord)1 TreeAttributeColumnData (org.knime.base.node.mine.treeensemble2.data.TreeAttributeColumnData)1 TreeAttributeColumnMetaData (org.knime.base.node.mine.treeensemble2.data.TreeAttributeColumnMetaData)1