"How to change role for attributes specified by regex?"
I have a group of attributes I want to change to a custom "donotuse" role. This is for data that should not be used in the model, isn't the ID column, but that I want to still keep associated with the predictions and results for other purposes.
What I've tried to do is specify a regular expression that identifies the attributes, and have a single ChangeAttributeRole nested inside. The FeatureIterator seemed like the right choice:
Thanks,
Keith
What I've tried to do is specify a regular expression that identifies the attributes, and have a single ChangeAttributeRole nested inside. The FeatureIterator seemed like the right choice:
But that only changes the role for the duration of that loop iteration. AttributeSubsetPreprocessing specifically says that role change are not preserved, so that's out. What's the right way to do it?
<operator name="FeatureIterator" class="FeatureIterator" expanded="yes">
<parameter key="filter" value="(name|address|city|state|zip)"/>
<operator name="ChangeAttributeRole" class="ChangeAttributeRole">
<parameter key="name" value="%{loop_feature}"/>
<parameter key="target_role" value="donotuse"/>
</operator>
</operator>
Thanks,
Keith