use of org.apache.ignite.ml.math.functions.IgniteDoubleConsumer in project ignite by apache.
the class AbstractCrossValidation method injectAndGetParametersFromPipeline.
/**
* Forms the parameter map from parameter grid and parameter set.
*
* @param paramGrid Parameter grid.
* @param paramSet Parameter set.
*/
@NotNull
private Map<String, Double> injectAndGetParametersFromPipeline(ParamGrid paramGrid, Double[] paramSet) {
Map<String, Double> paramMap = new HashMap<>();
for (int paramIdx = 0; paramIdx < paramSet.length; paramIdx++) {
IgniteDoubleConsumer setter = paramGrid.getSetterByIndex(paramIdx);
Double paramVal = paramSet[paramIdx];
setter.accept(paramVal);
paramMap.put(paramGrid.getParamNameByIndex(paramIdx), paramVal);
}
return paramMap;
}
Aggregations