public class ModelUtils extends Object
Model, to convert org.dmn.pmml objects to
Kie ones, etc...| Modifier and Type | Method and Description |
|---|---|
static org.kie.pmml.api.models.MiningField |
convertToKieMiningField(org.dmg.pmml.MiningField toConvert)
Return a
org.kie.pmml.api.models.MiningField out of a org.dmg.pmml.MiningField one |
static List<org.kie.pmml.api.models.MiningField> |
convertToKieMiningFieldList(org.dmg.pmml.MiningSchema toConvert)
Return a
List<org.kie.pmml.api.models.MiningField&glt; out of a org.dmg.pmml.MiningSchema one |
static org.kie.pmml.api.models.OutputField |
convertToKieOutputField(org.dmg.pmml.OutputField toConvert)
Return a
org.kie.pmml.api.models.OutputField out of a org.dmg.pmml.OutputField one |
static List<org.kie.pmml.api.models.OutputField> |
convertToKieOutputFieldList(org.dmg.pmml.Output toConvert)
Return a
List<org.kie.pmml.api.models.OutputField> out of a org.dmg.pmml.Output one |
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.api.enums.DATA_TYPE |
getDataType(org.dmg.pmml.DataDictionary dataDictionary,
String targetFieldName)
DATA_TYPE of the given field |
static org.kie.pmml.api.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.api.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.api.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.api.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.api.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.api.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.api.enums.DATA_TYPE getDataType(org.dmg.pmml.DataDictionary dataDictionary,
String targetFieldName)
DATA_TYPE of the given fielddataDictionary - targetFieldName - public static List<org.kie.pmml.api.models.MiningField> convertToKieMiningFieldList(org.dmg.pmml.MiningSchema toConvert)
List<org.kie.pmml.api.models.MiningField&glt; out of a org.dmg.pmml.MiningSchema onetoConvert - public static org.kie.pmml.api.models.MiningField convertToKieMiningField(org.dmg.pmml.MiningField toConvert)
org.kie.pmml.api.models.MiningField out of a org.dmg.pmml.MiningField onetoConvert - public static List<org.kie.pmml.api.models.OutputField> convertToKieOutputFieldList(org.dmg.pmml.Output toConvert)
List<org.kie.pmml.api.models.OutputField> out of a org.dmg.pmml.Output onetoConvert - public static org.kie.pmml.api.models.OutputField convertToKieOutputField(org.dmg.pmml.OutputField toConvert)
org.kie.pmml.api.models.OutputField out of a org.dmg.pmml.OutputField onetoConvert - 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.