Search in sources :

Example 1 with PMMLPreprocDiscretize

use of org.knime.core.util.binning.auto.pmml.PMMLPreprocDiscretize in project knime-core by knime.

the class AutoBinnerUtility method createDisretizeOp.

private static PMMLPreprocDiscretize createDisretizeOp(final AutoBinnerLearnSettings settings, final Map<String, double[]> edgesMap, final String[] includeCols) {
    final Map<String, List<PMMLDiscretizeBin>> binMap = createBins(settings, edgesMap, includeCols);
    final List<String> names = new ArrayList<String>();
    final Map<String, PMMLDiscretize> discretize = new HashMap<String, PMMLDiscretize>();
    for (String target : includeCols) {
        final String binnedCol = settings.getReplaceColumn() ? target : target + " [Binned]";
        names.add(binnedCol);
        discretize.put(binnedCol, new PMMLDiscretize(target, binMap.get(target)));
    }
    final DisretizeConfiguration config = new DisretizeConfiguration(names, discretize);
    return new PMMLPreprocDiscretize(config);
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) DisretizeConfiguration(org.knime.core.util.binning.auto.pmml.DisretizeConfiguration) ArrayList(java.util.ArrayList) PMMLDiscretize(org.knime.core.util.binning.auto.pmml.PMMLDiscretize) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) PMMLPreprocDiscretize(org.knime.core.util.binning.auto.pmml.PMMLPreprocDiscretize)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 DisretizeConfiguration (org.knime.core.util.binning.auto.pmml.DisretizeConfiguration)1 PMMLDiscretize (org.knime.core.util.binning.auto.pmml.PMMLDiscretize)1 PMMLPreprocDiscretize (org.knime.core.util.binning.auto.pmml.PMMLPreprocDiscretize)1