public class ModelUtils extends Object
Model| Modifier and Type | Method and Description |
|---|---|
static String |
getBoxedClassName(org.dmg.pmml.DataType dataType)
Retrieve the mapped class name of the given
DataType, eventually boxed (for primitive ones). |
static String |
getBoxedClassName(org.dmg.pmml.ParameterField parameterField)
Retrieve the mapped class name of the given
ParameterField, eventually boxed (for primitive ones)
It returns Object ParameterField.getDataType() is null |
static org.kie.pmml.commons.model.enums.DATA_TYPE |
getDataType(org.dmg.pmml.DataDictionary dataDictionary,
String targetFieldName)
DATA_TYPE of the given field |
static org.kie.pmml.commons.model.enums.OP_TYPE |
getOpType(org.dmg.pmml.DataDictionary dataDictionary,
org.dmg.pmml.Model model,
String targetFieldName)
OP_TYPE may be defined inside DataField, MiningField or both. |
static Optional<String> |
getTargetFieldName(org.dmg.pmml.DataDictionary dataDictionary,
org.dmg.pmml.Model model)
Return an
Optional with the name of the field whose usageType is TARGET or PREDICTED
While the xsd schema does not strictly enforce this, it seems that by convention majority of models has only one target. |
static List<org.kie.pmml.commons.model.tuples.KiePMMLNameOpType> |
getTargetFields(org.dmg.pmml.DataDictionary dataDictionary,
org.dmg.pmml.Model model)
Return a
List<KiePMMLNameOpType> of target fields |
static Map<String,org.kie.pmml.commons.model.enums.DATA_TYPE> |
getTargetFieldsTypeMap(org.dmg.pmml.DataDictionary dataDictionary,
org.dmg.pmml.Model model)
Returns a
Map<String, DATA_TYPE> of target fields, where the key is the name of the field, and the value is the type of the field |
static org.kie.pmml.commons.model.enums.DATA_TYPE |
getTargetFieldType(org.dmg.pmml.DataDictionary dataDictionary,
org.dmg.pmml.Model model)
Return the
DATA_TYPE> of the field whose usageType is TARGET or PREDICTED. |
public static Optional<String> getTargetFieldName(org.dmg.pmml.DataDictionary dataDictionary, org.dmg.pmml.Model model)
Optional with the name of the field whose usageType is TARGET or PREDICTED
While the xsd schema does not strictly enforce this, it seems that by convention majority of models has only one target.
(see https://github.com/jpmml/jpmml-evaluator/issues/64 discussion)
model - public static org.kie.pmml.commons.model.enums.DATA_TYPE getTargetFieldType(org.dmg.pmml.DataDictionary dataDictionary,
org.dmg.pmml.Model model)
DATA_TYPE> of the field whose usageType is TARGET or PREDICTED.
It throws exception if none of such fields are found
While the xsd schema does not strictly enforce this, it seems that by convention majority of models has only one target.
(see https://github.com/jpmml/jpmml-evaluator/issues/64 discussion)
dataDictionary - model - public static List<org.kie.pmml.commons.model.tuples.KiePMMLNameOpType> getTargetFields(org.dmg.pmml.DataDictionary dataDictionary, org.dmg.pmml.Model model)
List<KiePMMLNameOpType> of target fieldsdataDictionary - model - public static Map<String,org.kie.pmml.commons.model.enums.DATA_TYPE> getTargetFieldsTypeMap(org.dmg.pmml.DataDictionary dataDictionary, org.dmg.pmml.Model model)
Map<String, DATA_TYPE> of target fields, where the key is the name of the field, and the value is the type of the fielddataDictionary - model - public static org.kie.pmml.commons.model.enums.OP_TYPE getOpType(org.dmg.pmml.DataDictionary dataDictionary,
org.dmg.pmml.Model model,
String targetFieldName)
OP_TYPE may be defined inside DataField, MiningField or both.
In the latter case, MiningField override DataField definitiondataDictionary - model - targetFieldName - public static org.kie.pmml.commons.model.enums.DATA_TYPE getDataType(org.dmg.pmml.DataDictionary dataDictionary,
String targetFieldName)
DATA_TYPE of the given fielddataDictionary - targetFieldName - public static String getBoxedClassName(org.dmg.pmml.ParameterField parameterField)
ParameterField, eventually boxed (for primitive ones)
It returns Object ParameterField.getDataType() is nullparameterField - public static String getBoxedClassName(org.dmg.pmml.DataType dataType)
DataType, eventually boxed (for primitive ones).
It returns Object if nulldataType - Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.