how to convert polynomial to binomial

pseoyeon5pseoyeon5 Member Posts: 3 Contributor I
edited November 2018 in Help

Hi, I have a data set with the column (IDKC WS(10)) of polynomial labels ("W","M", "I"). I use ExampleFilter to remove rows whose values are "I" so the column has two classes now. but Rapidminer thinks that the column is still polynomial so I cannot run logistic regression using the column as dependent variable. what should I do? Thanks!



<?xml version="1.0" encoding="UTF-8"?><process version="8.0.001">
<operator activated="true" class="process" compatibility="8.0.001" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="8.0.001" expanded="true" height="68" name="Retrieve Delete blank-Seoyeon’s MacBook Pro-4" width="90" x="112" y="85">
<parameter key="repository_entry" value="../data/Delete blank-Seoyeon’s MacBook Pro-4"/>
<operator activated="true" class="filter_examples" compatibility="8.0.001" expanded="true" height="103" name="Filter Examples" width="90" x="112" y="187">
<list key="filters_list">
<parameter key="filters_entry_key" value="IDKC WS(10).does_not_equal.I"/>
<operator activated="true" class="select_attributes" compatibility="8.0.001" expanded="true" height="82" name="Select Attributes" width="90" x="112" y="340">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attributes" value="IDKC_Ave_First Attempt_Opp1|IDPT_Ave_First Attempt_OPP1|ID_Ave_FirstAttempt_Opp1|KC_Ave_FirstAttempt_Opp1|PT_Ave_FirstAttempt_Opp1|IDKC WS(10)"/>
<operator activated="true" class="set_role" compatibility="8.0.001" expanded="true" height="82" name="Set Role" width="90" x="112" y="493">
<parameter key="attribute_name" value="IDKC WS(10)"/>
<parameter key="target_role" value="label"/>
<list key="set_additional_roles"/>
<operator activated="true" class="concurrency:cross_validation" compatibility="8.0.001" expanded="true" height="145" name="Cross Validation" width="90" x="447" y="136">
<parameter key="sampling_type" value="stratified sampling"/>
<process expanded="true">
<operator activated="true" class="h2o:logistic_regression" compatibility="7.6.001" expanded="true" height="124" name="Logistic Regression" width="90" x="112" y="34"/>
<connect from_port="training set" to_op="Logistic Regression" to_port="training set"/>
<connect from_op="Logistic Regression" from_port="model" to_port="model"/>
<portSpacing port="source_training set" spacing="0"/>
<portSpacing port="sink_model" spacing="0"/>
<portSpacing port="sink_through 1" spacing="0"/>
<process expanded="true">
<operator activated="true" class="apply_model" compatibility="8.0.001" expanded="true" height="82" name="Apply Model" width="90" x="45" y="34">
<list key="application_parameters"/>
<operator activated="true" class="performance_classification" compatibility="8.0.001" expanded="true" height="82" name="Performance" width="90" x="246" y="85">
<parameter key="classification_error" value="true"/>
<parameter key="kappa" value="true"/>
<parameter key="root_mean_squared_error" value="true"/>
<parameter key="correlation" value="true"/>
<list key="class_weights"/>
<connect from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
<connect from_op="Performance" from_port="performance" to_port="performance 1"/>
<connect from_op="Performance" from_port="example set" to_port="test set results"/>
<portSpacing port="source_model" spacing="0"/>
<portSpacing port="source_test set" spacing="0"/>
<portSpacing port="source_through 1" spacing="0"/>
<portSpacing port="sink_test set results" spacing="0"/>
<portSpacing port="sink_performance 1" spacing="0"/>
<portSpacing port="sink_performance 2" spacing="0"/>
<operator activated="true" class="apply_model" compatibility="8.0.001" expanded="true" height="82" name="Apply Model (2)" width="90" x="581" y="136">
<list key="application_parameters"/>
<operator activated="true" class="performance_classification" compatibility="8.0.001" expanded="true" height="82" name="Performance (2)" width="90" x="782" y="136">
<parameter key="classification_error" value="true"/>
<parameter key="root_mean_squared_error" value="true"/>
<list key="class_weights"/>
<connect from_op="Retrieve Delete blank-Seoyeon’s MacBook Pro-4" from_port="output" to_op="Filter Examples" to_port="example set input"/>
<connect from_op="Filter Examples" from_port="example set 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="Cross Validation" to_port="example set"/>
<connect from_op="Cross Validation" from_port="model" to_op="Apply Model (2)" to_port="model"/>
<connect from_op="Cross Validation" from_port="example set" to_op="Apply Model (2)" to_port="unlabelled data"/>
<connect from_op="Apply Model (2)" from_port="labelled data" to_op="Performance (2)" to_port="labelled data"/>
<connect from_op="Apply Model (2)" from_port="model" to_port="result 2"/>
<connect from_op="Performance (2)" from_port="performance" to_port="result 1"/>
<connect from_op="Performance (2)" from_port="example set" to_port="result 3"/>
<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"/>
<portSpacing port="sink_result 4" spacing="0"/>

Best Answer

  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Solution Accepted

    You simply need to add the "Nominal to Binominal" operator before your LR model.  Sometimes you may also need to use "Remove Unused Values" before that transformation to ensure that RapidMiner knows the 3rd nominal value is no longer present in the dataset. 

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts


  • earmijoearmijo Member Posts: 270 Unicorn

    @Telcontar120 : Thanks for letting us know about the operator "Remove Unused Values" in this context. 


    I think that after you use that operator you don't need to transform to Binomial. The operator Logistic Regression may throw a warning saying that it cannot deal with polynominal variables but no error will result. 


    If you transform to Binomial you would be creating two variables and then would have to get rid of one of them. 

Sign In or Register to comment.