use of org.knime.core.util.Pair in project knime-core by knime.
the class TypeSelectionConfiguration method configure.
@Override
public List<Pair<String, PaneConfigurationDialog>> configure(final DataTableSpec spec) {
List<Pair<String, PaneConfigurationDialog>> r = new ArrayList<Pair<String, PaneConfigurationDialog>>();
for (DropPaneConfig dpc : m_panelList.values()) {
String type = dpc.getSelection().get(0);
DataType t = StringCell.TYPE;
if (type.equals("IntCell")) {
t = IntCell.TYPE;
} else if (type.equals("DoubleCell")) {
t = DoubleCell.TYPE;
} else if (type.equals("LongCell")) {
t = LongCell.TYPE;
} else if (type.equals("DateAndTimeCell")) {
t = DateAndTimeCell.TYPE;
} else if (type.equals("XMLCell")) {
t = XMLCell.TYPE;
} else if (type.equals("PMMLCell")) {
t = PMMLCell.TYPE;
}
for (DataColumnSpec dcs : spec) {
if (dcs.getType().equals(t)) {
r.add(new Pair<String, PaneConfigurationDialog>(dcs.getName(), dpc.getDialog()));
}
}
}
return r;
}
use of org.knime.core.util.Pair in project knime-core by knime.
the class AbstractGBTModelImporter method readTreeModel.
private Pair<TreeModelRegression, Map<TreeNodeSignature, Double>> readTreeModel(final Segment segment) {
GBTRegressionContentParser contentParser = new GBTRegressionContentParser();
TreeModelImporter<TreeNodeRegression, TreeModelRegression, TreeTargetNumericColumnMetaData> treeImporter = new TreeModelImporter<TreeNodeRegression, TreeModelRegression, TreeTargetNumericColumnMetaData>(m_metaDataMapper, m_conditionParser, m_signatureFactory, contentParser, m_treeFactory);
TreeModel treeModel = segment.getTreeModel();
TreeModelRegression tree = treeImporter.importFromPMML(treeModel);
Map<TreeNodeSignature, Double> coefficientMap = contentParser.getCoefficientMap();
return new Pair<>(tree, coefficientMap);
}
use of org.knime.core.util.Pair in project knime-core by knime.
the class AbstractGBTModelImporter method readSumSegmentation.
protected Pair<List<TreeModelRegression>, List<Map<TreeNodeSignature, Double>>> readSumSegmentation(final Segmentation segmentation) {
List<Segment> segments = segmentation.getSegmentList();
List<TreeModelRegression> trees = new ArrayList<>(segments.size());
List<Map<TreeNodeSignature, Double>> coefficientMaps = new ArrayList<>(segments.size());
for (Segment segment : segments) {
Pair<TreeModelRegression, Map<TreeNodeSignature, Double>> treeCoeffientMapPair = readTreeModel(segment);
trees.add(treeCoeffientMapPair.getFirst());
coefficientMaps.add(treeCoeffientMapPair.getSecond());
}
return new Pair<>(trees, coefficientMaps);
}
use of org.knime.core.util.Pair in project knime-core by knime.
the class AppendVariableToTableNodeModel method getAllVariables.
private List<Pair<String, FlowVariable.Type>> getAllVariables() {
Map<String, FlowVariable> currentVars = getAvailableFlowVariables();
List<Pair<String, FlowVariable.Type>> variables;
variables = new ArrayList<Pair<String, FlowVariable.Type>>();
for (FlowVariable v : currentVars.values()) {
variables.add(new Pair<String, FlowVariable.Type>(v.getName(), v.getType()));
}
return variables;
}
use of org.knime.core.util.Pair in project knime-core by knime.
the class VariableToTableNodeModel method getAllVariables.
private List<Pair<String, FlowVariable.Type>> getAllVariables() {
Map<String, FlowVariable> currentVars = getAvailableFlowVariables();
List<Pair<String, FlowVariable.Type>> variables;
variables = new ArrayList<Pair<String, FlowVariable.Type>>();
for (FlowVariable v : currentVars.values()) {
variables.add(new Pair<String, FlowVariable.Type>(v.getName(), v.getType()));
}
return variables;
}
Aggregations