🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

"How to change role for attributes specified by regex?"

User: "keith"
New Altair Community Member
Updated by Jocelyn
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:

        <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>
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?

Thanks,
Keith

Find more posts tagged with