Search in sources :

Example 1 with TransformationDictionary

use of org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary in project knime-core by knime.

the class PMMLOne2ManyTranslator method exportToTransDict.

/**
 * {@inheritDoc}
 */
@Override
public TransformationDictionary exportToTransDict() {
    TransformationDictionary dictionary = TransformationDictionary.Factory.newInstance();
    dictionary.setDerivedFieldArray(createDerivedFields());
    return dictionary;
}
Also used : TransformationDictionary(org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary)

Example 2 with TransformationDictionary

use of org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary in project knime-core by knime.

the class PMMLMany2OneTranslator method exportToTransDict.

/**
 * {@inheritDoc}
 */
@Override
public TransformationDictionary exportToTransDict() {
    final TransformationDictionary dictionary = TransformationDictionary.Factory.newInstance();
    dictionary.setDerivedFieldArray(new DerivedField[] { createDerivedField() });
    return dictionary;
}
Also used : TransformationDictionary(org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary)

Example 3 with TransformationDictionary

use of org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary in project knime-core by knime.

the class PMMLOne2ManyTranslator method exportToTransDict.

/**
 * {@inheritDoc}
 */
@Override
public TransformationDictionary exportToTransDict() {
    TransformationDictionary dictionary = TransformationDictionary.Factory.newInstance();
    dictionary.setDerivedFieldArray(createDerivedFields());
    return dictionary;
}
Also used : TransformationDictionary(org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary)

Example 4 with TransformationDictionary

use of org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary in project knime-core by knime.

the class PMMLMissingValueReplacementTranslator method exportTo.

/**
 * {@inheritDoc}
 */
@Override
public SchemaType exportTo(final PMMLDocument pmmlDoc, final PMMLPortObjectSpec spec) {
    TransformationDictionary td = pmmlDoc.getPMML().getTransformationDictionary();
    if (td == null) {
        td = pmmlDoc.getPMML().addNewTransformationDictionary();
    }
    DerivedFieldMapper mapper = new DerivedFieldMapper(pmmlDoc);
    for (MissingCellHandler handler : m_handlers) {
        DerivedField f = handler.getPMMLDerivedField();
        if (f != null) {
            f.setDisplayName(f.getName());
            f.setName(mapper.createDerivedFieldName(f.getName()));
            td.getDerivedFieldList().add(f);
        }
    }
    return null;
}
Also used : DerivedFieldMapper(org.knime.core.node.port.pmml.preproc.DerivedFieldMapper) TransformationDictionary(org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary) DerivedField(org.dmg.pmml.DerivedFieldDocument.DerivedField)

Example 5 with TransformationDictionary

use of org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary in project knime-core by knime.

the class PMMLStringConversionTranslator method exportToTransDict.

/**
 * {@inheritDoc}
 */
@Override
public TransformationDictionary exportToTransDict() {
    TransformationDictionary dictionary = TransformationDictionary.Factory.newInstance();
    dictionary.setDerivedFieldArray(createDerivedFields());
    return dictionary;
}
Also used : TransformationDictionary(org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary)

Aggregations

TransformationDictionary (org.dmg.pmml.TransformationDictionaryDocument.TransformationDictionary)19 DerivedField (org.dmg.pmml.DerivedFieldDocument.DerivedField)4 DerivedFieldMapper (org.knime.core.node.port.pmml.preproc.DerivedFieldMapper)4 LocalTransformations (org.dmg.pmml.LocalTransformationsDocument.LocalTransformations)3 PMML (org.dmg.pmml.PMMLDocument.PMML)3 PMMLPortObject (org.knime.core.node.port.pmml.PMMLPortObject)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 ClusteringModel (org.dmg.pmml.ClusteringModelDocument.ClusteringModel)2 GeneralRegressionModel (org.dmg.pmml.GeneralRegressionModelDocument.GeneralRegressionModel)2 NeuralNetwork (org.dmg.pmml.NeuralNetworkDocument.NeuralNetwork)2 RegressionModel (org.dmg.pmml.RegressionModelDocument.RegressionModel)2 RuleSetModel (org.dmg.pmml.RuleSetModelDocument.RuleSetModel)2 SupportVectorMachineModel (org.dmg.pmml.SupportVectorMachineModelDocument.SupportVectorMachineModel)2 TreeModel (org.dmg.pmml.TreeModelDocument.TreeModel)2 DataTableSpec (org.knime.core.data.DataTableSpec)2 PMMLPortObjectSpecCreator (org.knime.core.node.port.pmml.PMMLPortObjectSpecCreator)2 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1