PMML 你能删除字符串中的特殊字符吗?

PMML Can you remove special characters in strings?

有没有办法删除 pmml 字符串中的特殊字符?类似下面的内容,但我添加了一个组成的函数调用 "removeSpecialCharacters".

<DerivedField name="stringmatch" datatype="string" optype="categorical">
     <Apply function="if">
          <Apply function="equal">
                <Apply function="removeSpecialCharacters">
                     <FieldRef="string1"/>
                </Apply>
                <Apply function="removeSpecialCharacters">
                     <FieldRef="string2"/>
                </Apply>
          </Apply>
     <Constant>1</Constant>
     <Constant>0</Constant>
     </Apply>
<DerivedField/>

匹配时结果为 1,不匹配时结果为 0。

您可以使用 built-in PMML replace 函数删除特殊字符 - 只需指定一个空字符串作为替换值。