set Minus operator gives not correct results?

Fred12Fred12 Member Posts: 344   Unicorn
edited November 2018 in Help

hi,

I am trying since hours on a simple problem that drives me mad..

I compare 2 da tasets and want the dataset that is not in the other, I get it via the set minus operator, I have the ID attribute on both the same column, however, I get either non or all datasets in return... whats the problem?

 

<?xml version="1.0" encoding="UTF-8"?><process version="7.2.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.2.001" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="7.2.001" expanded="true" height="68" name="Retrieve Z518B_0.75_RegionTable_AxioVision_ID_Faserlänge" width="90" x="45" y="238">
<parameter key="repository_entry" value="//RapidMiner_Nils/Nils/Master/Data/Einzellisten/Z518B_0.75_RegionTable_AxioVision_ID_Faserlänge"/>
</operator>
<operator activated="true" class="rename_by_replacing" compatibility="7.2.001" expanded="true" height="82" name="Rename by Replacing" width="90" x="179" y="238">
<parameter key="attributes" value="F9::FeretMaximum !!R|F8::Faserlänge !!R|F6::EllipsekleineHalbachse !!R|F5::EllipsegroßeHalbachse !!R|F4::Durchmessergefüllt !!R|F3::Durchmesser !!R|F30::GrauwertMittelwert !!R|F29::GrauwertMinimum !!R|F28::GrauwertMaximum !!R|F27::Umfangkonvex !!R|F26::Umfanggefüllt !!R|F23::Umfang !!R|F22::Radius !!R|F21::MaximalereingeschriebenerKreis !!R|F20::IndexRegion!!I|F19::Formfaktor!!R|F17::FlächezuGesamtfläche !!R|F16::Flächekonvex !!R|F15::Flächegefüllt !!R|F14::Fläche !!R|F13::Feretverhältnis!!R|F11::FeretMinimum !!R"/>
<parameter key="include_special_attributes" value="true"/>
<parameter key="replace_what" value=".*::(.*)!!.*"/>
<parameter key="replace_by" value="$1"/>
</operator>
<operator activated="true" class="rename_by_replacing" compatibility="7.2.001" expanded="true" height="82" name="Rename by Replacing (2)" width="90" x="313" y="238">
<parameter key="include_special_attributes" value="true"/>
<parameter key="replace_what" value=".*::(.*)\s.*"/>
</operator>
<operator activated="true" class="set_role" compatibility="7.2.001" expanded="true" height="82" name="Set Role (2)" width="90" x="447" y="238">
<parameter key="attribute_name" value="Faserlänge "/>
<parameter key="target_role" value="id"/>
<list key="set_additional_roles">
<parameter key="Faserlänge " value="id"/>
</list>
</operator>
<operator activated="true" class="retrieve" compatibility="7.2.001" expanded="true" height="68" name="Retrieve Probe_MIT_LABEL_Z518B (2)" width="90" x="112" y="34">
<parameter key="repository_entry" value="//RapidMiner_Nils/Nils/Master/Data/Einzellisten/Probe_MIT_LABEL_Z518B"/>
</operator>
<operator activated="true" class="set_minus" compatibility="7.2.001" expanded="true" height="82" name="Set Minus" width="90" x="715" y="340"/>
<connect from_op="Retrieve Z518B_0.75_RegionTable_AxioVision_ID_Faserlänge" from_port="output" to_op="Rename by Replacing" to_port="example set input"/>
<connect from_op="Rename by Replacing" from_port="example set output" to_op="Rename by Replacing (2)" to_port="example set input"/>
<connect from_op="Rename by Replacing (2)" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
<connect from_op="Set Role (2)" from_port="example set output" to_op="Set Minus" to_port="subtrahend"/>
<connect from_op="Retrieve Probe_MIT_LABEL_Z518B (2)" from_port="output" to_op="Set Minus" to_port="example set input"/>
<connect from_op="Set Minus" from_port="example set output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>

Answers

  • bhupendra_patilbhupendra_patil Employee, Member Posts: 167  RM Data Scientist

    "set minus"  gives records from "exa" that are not in "sub" port.

     

    I just checked the operator and it seems to working correctly, may be something with the ids in your data?

    Are they of the same type? 

  • Fred12Fred12 Member Posts: 344   Unicorn

    yes both are of type real with id role

     

    I have similar process here where I want all rows from one dataset that have same ID like the ID from the other dataset.. but I get empty result:

    <?xml version="1.0" encoding="UTF-8"?><process version="7.2.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="7.2.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="7.2.001" expanded="true" height="68" name="Retrieve Probe_Z518B_mit_Label_bereinigt" width="90" x="179" y="289">
    <parameter key="repository_entry" value="//Marc/data/Probe_Z518B_mit_Label_bereinigt"/>
    </operator>
    <operator activated="true" class="retrieve" compatibility="7.2.001" expanded="true" height="68" name="Retrieve Z518B_0.75_RegionTable_AxioVision_ohneProbe_ohneLabel_bereinigt (2)" width="90" x="179" y="391">
    <parameter key="repository_entry" value="//Marc/data/Z518B_0.75_RegionTable_AxioVision_ohneProbe_ohneLabel_bereinigt"/>
    </operator>
    <operator activated="true" class="select_attributes" compatibility="7.2.001" expanded="true" height="82" name="Select Attributes" width="90" x="380" y="391">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="Faserlänge "/>
    <parameter key="attributes" value="Faserlänge "/>
    <parameter key="include_special_attributes" value="true"/>
    </operator>
    <operator activated="true" class="set_role" compatibility="7.2.001" expanded="true" height="82" name="Set Role" width="90" x="514" y="391">
    <parameter key="attribute_name" value="Faserlänge "/>
    <parameter key="target_role" value="id"/>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="intersect" compatibility="7.2.001" expanded="true" height="82" name="Intersect" width="90" x="715" y="136"/>
    <connect from_op="Retrieve Probe_Z518B_mit_Label_bereinigt" from_port="output" to_op="Intersect" to_port="example set input"/>
    <connect from_op="Retrieve Z518B_0.75_RegionTable_AxioVision_ohneProbe_ohneLabel_bereinigt (2)" from_port="output" to_op="Select Attributes" to_port="example set input"/>
    <connect from_op="Select Attributes" from_port="example set output" to_op="Set Role" to_port="example set input"/>
    <connect from_op="Set Role" from_port="example set output" to_op="Intersect" to_port="second"/>
    <connect from_op="Intersect" from_port="example set output" to_port="result 1"/>
    <connect from_op="Intersect" from_port="original" to_port="result 2"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    <portSpacing port="sink_result 3" spacing="0"/>
    </process>
    </operator>
    </process>

     edit: I tried with other dataset from sample..Deals and Deals Testset and it worked fine... just not with my dataset, should I send it to you via PM?

Sign In or Register to comment.