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,
org.dmg.pmml.DataField dataField)
Return a
org.kie.pmml.api.models.MiningField out of a org.dmg.pmml.MiningField and
relative org.dmg.pmml.DataField ones |
static List<org.kie.pmml.api.models.MiningField> |
convertToKieMiningFieldList(org.dmg.pmml.MiningSchema toConvert,
org.dmg.pmml.DataDictionary dataDictionary)
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,
org.dmg.pmml.DataField dataField)
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,
org.dmg.pmml.DataDictionary dataDictionary)
Return a
List<org.kie.pmml.api.models.OutputField> out of a org.dmg.pmml
.Output one |
static org.kie.pmml.commons.model.expressions.KiePMMLApply |
convertToKiePMMLApply(org.dmg.pmml.Apply toConvert) |
static org.kie.pmml.commons.model.expressions.KiePMMLConstant |
convertToKiePMMLConstant(org.dmg.pmml.Constant toConvert) |
static org.kie.pmml.commons.model.expressions.KiePMMLExpression |
convertToKiePMMLExpression(org.dmg.pmml.Expression toConvert) |
static List<org.kie.pmml.commons.model.expressions.KiePMMLExpression> |
convertToKiePMMLExpressions(List<org.dmg.pmml.Expression> toConvert) |
static org.kie.pmml.commons.model.expressions.KiePMMLFieldRef |
convertToKiePMMLFieldRef(org.dmg.pmml.FieldRef toConvert) |
static org.kie.pmml.commons.model.KiePMMLOutputField |
convertToKiePMMLOutputField(org.dmg.pmml.OutputField toConvert)
Return a
org.kie.pmml.commons.model.KiePMMLOutputField out of a org.dmg.pmml
.OutputField |
static List<org.kie.pmml.commons.model.KiePMMLOutputField> |
convertToKiePMMLOutputFieldList(org.dmg.pmml.Output toConvert)
Return a
List<org.kie.pmml.commons.model.KiePMMLOutputField> out of a org.dmg.pmml
.Output |
static org.kie.pmml.commons.model.KiePMMLTarget |
convertToKiePMMLTarget(org.dmg.pmml.Target toConvert)
Return a
org.kie.pmml.commons.model.KiePMMLTarget out of a org.dmg.pmml.Target |
static List<org.kie.pmml.commons.model.KiePMMLTarget> |
convertToKiePMMLTargetList(org.dmg.pmml.Targets toConvert)
Return a
List<org.kie.pmml.commons.model.KiePMMLTarget> out of a org.dmg.pmml
.Targets |
static org.kie.pmml.commons.model.KiePMMLTargetValue |
convertToKiePMMLTargetValue(org.dmg.pmml.TargetValue toConvert)
Return a
org.kie.pmml.commons.model.KiePMMLTargetValue out of a org.dmg.pmml
.TargetValue |
static List<org.kie.pmml.commons.model.KiePMMLTargetValue> |
convertToKiePMMLTargetValueList(List<org.dmg.pmml.TargetValue> toConvert)
Return a
List<org.kie.pmml.commons.model.KiePMMLTargetValue> out of a
List<org.dmg.pmml.TargetValue> |
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.dmg.pmml.DataType |
getDataType(List<org.dmg.pmml.DerivedField> derivedFields,
org.dmg.pmml.DataDictionary dataDictionary,
String fieldName)
DataType of the given field, first looked upon derivedFields and then in
dataDictionary |
static List<org.dmg.pmml.DerivedField> |
getDerivedFields(org.dmg.pmml.TransformationDictionary transformationDictionary,
org.dmg.pmml.LocalTransformations localTransformations)
Return
List<DerivedField>s from the given TransformationDictionary and
LocalTransformations |
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<org.kie.pmml.api.enums.OP_TYPE> |
getOpTypeFromDataDictionary(org.dmg.pmml.DataDictionary dataDictionary,
String fieldName)
Return
Optional<OP_TYPE> of field with given fieldName from DataDictionary |
static Optional<org.kie.pmml.api.enums.OP_TYPE> |
getOpTypeFromMiningFields(org.dmg.pmml.MiningSchema miningSchema,
String fieldName)
Return
Optional<OP_TYPE> of field with given fieldName from MiningSchema |
static Optional<org.kie.pmml.api.enums.OP_TYPE> |
getOpTypeFromTargets(org.dmg.pmml.Targets targets,
String fieldName)
Return
Optional<OP_TYPE> of field with given fieldName from Targets |
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
Please note that only predicted/target
MiningField are considered. |
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
Please note that only predicted/target
MiningField are considered. |
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 fields
Please note that only predicted/target
MiningField are considered.dataDictionary - 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 field
Please note that only predicted/target
MiningField are considered.dataDictionary - 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 Optional<org.kie.pmml.api.enums.OP_TYPE> getOpTypeFromDataDictionary(org.dmg.pmml.DataDictionary dataDictionary, String fieldName)
Optional<OP_TYPE> of field with given fieldName from DataDictionarydataDictionary - fieldName - public static Optional<org.kie.pmml.api.enums.OP_TYPE> getOpTypeFromMiningFields(org.dmg.pmml.MiningSchema miningSchema, String fieldName)
Optional<OP_TYPE> of field with given fieldName from MiningSchemaminingSchema - fieldName - public static Optional<org.kie.pmml.api.enums.OP_TYPE> getOpTypeFromTargets(org.dmg.pmml.Targets targets, String fieldName)
Optional<OP_TYPE> of field with given fieldName from Targetstargets - fieldName - public static org.dmg.pmml.DataType getDataType(List<org.dmg.pmml.DerivedField> derivedFields, org.dmg.pmml.DataDictionary dataDictionary, String fieldName)
DataType of the given field, first looked upon derivedFields and then in
dataDictionaryderivedFields - dataDictionary - fieldName - 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.dmg.pmml.DerivedField> getDerivedFields(org.dmg.pmml.TransformationDictionary transformationDictionary, org.dmg.pmml.LocalTransformations localTransformations)
List<DerivedField>s from the given TransformationDictionary and
LocalTransformationstransformationDictionary - localTransformations - public static List<org.kie.pmml.api.models.MiningField> convertToKieMiningFieldList(org.dmg.pmml.MiningSchema toConvert, org.dmg.pmml.DataDictionary dataDictionary)
List<org.kie.pmml.api.models.MiningField&glt; out of a org.dmg.pmml
.MiningSchema onetoConvert - dataDictionary - public static org.kie.pmml.api.models.MiningField convertToKieMiningField(org.dmg.pmml.MiningField toConvert,
org.dmg.pmml.DataField dataField)
org.kie.pmml.api.models.MiningField out of a org.dmg.pmml.MiningField and
relative org.dmg.pmml.DataField onestoConvert - dataField - public static List<org.kie.pmml.api.models.OutputField> convertToKieOutputFieldList(org.dmg.pmml.Output toConvert, org.dmg.pmml.DataDictionary dataDictionary)
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.dmg.pmml.DataField dataField)
org.kie.pmml.api.models.OutputField out of a org.dmg.pmml.OutputField onetoConvert - dataField - - this may be nullpublic static List<org.kie.pmml.commons.model.KiePMMLOutputField> convertToKiePMMLOutputFieldList(org.dmg.pmml.Output toConvert)
List<org.kie.pmml.commons.model.KiePMMLOutputField> out of a org.dmg.pmml
.OutputtoConvert - public static org.kie.pmml.commons.model.KiePMMLOutputField convertToKiePMMLOutputField(org.dmg.pmml.OutputField toConvert)
org.kie.pmml.commons.model.KiePMMLOutputField out of a org.dmg.pmml
.OutputFieldtoConvert - public static List<org.kie.pmml.commons.model.expressions.KiePMMLExpression> convertToKiePMMLExpressions(List<org.dmg.pmml.Expression> toConvert)
public static org.kie.pmml.commons.model.expressions.KiePMMLExpression convertToKiePMMLExpression(org.dmg.pmml.Expression toConvert)
public static org.kie.pmml.commons.model.expressions.KiePMMLApply convertToKiePMMLApply(org.dmg.pmml.Apply toConvert)
public static org.kie.pmml.commons.model.expressions.KiePMMLConstant convertToKiePMMLConstant(org.dmg.pmml.Constant toConvert)
public static org.kie.pmml.commons.model.expressions.KiePMMLFieldRef convertToKiePMMLFieldRef(org.dmg.pmml.FieldRef toConvert)
public static List<org.kie.pmml.commons.model.KiePMMLTarget> convertToKiePMMLTargetList(org.dmg.pmml.Targets toConvert)
List<org.kie.pmml.commons.model.KiePMMLTarget> out of a org.dmg.pmml
.TargetstoConvert - public static org.kie.pmml.commons.model.KiePMMLTarget convertToKiePMMLTarget(org.dmg.pmml.Target toConvert)
org.kie.pmml.commons.model.KiePMMLTarget out of a org.dmg.pmml.TargettoConvert - public static List<org.kie.pmml.commons.model.KiePMMLTargetValue> convertToKiePMMLTargetValueList(List<org.dmg.pmml.TargetValue> toConvert)
List<org.kie.pmml.commons.model.KiePMMLTargetValue> out of a
List<org.dmg.pmml.TargetValue>toConvert - public static org.kie.pmml.commons.model.KiePMMLTargetValue convertToKiePMMLTargetValue(org.dmg.pmml.TargetValue toConvert)
org.kie.pmml.commons.model.KiePMMLTargetValue out of a org.dmg.pmml
.TargetValuetoConvert - 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–2021 JBoss by Red Hat. All rights reserved.