The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Target class Logistic regression

User141505User141505 Member Posts: 8 Contributor II
edited December 2021 in Help
Hi.
how do i set the target class  for the logistic regression? I do not mean the label attribute for the prediction, but which one of the two possible values in the label attribute is considered as "Positive value" as indicated in the confusion matrix.
It could help me not to get confused when evaluating evaluate sensitivity and specificity.

Thanks

Best Answer

  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
    Solution Accepted
    You can use the Operator "Set Positive" to set the positive value. 

    Here's a sample process:



    <?xml version="1.0" encoding="UTF-8"?><process version="9.10.001"><br>  <context><br>    <input/><br>    <output/><br>    <macros/><br>  </context><br>  <operator activated="true" class="process" compatibility="9.10.001" expanded="true" name="Process" origin="GENERATED_TUTORIAL"><br>    <parameter key="logverbosity" value="init"/><br>    <parameter key="random_seed" value="2001"/><br>    <parameter key="send_mail" value="never"/><br>    <parameter key="notification_email" value=""/><br>    <parameter key="process_duration_for_mail" value="30"/><br>    <parameter key="encoding" value="SYSTEM"/><br>    <process expanded="true"><br>      <operator activated="true" class="retrieve" compatibility="9.10.001" expanded="true" height="68" name="Retrieve Golf" origin="GENERATED_TUTORIAL" width="90" x="112" y="34"><br>        <parameter key="repository_entry" value="//Samples/data/Golf"/><br>      </operator><br>      <operator activated="true" class="multiply" compatibility="9.10.001" expanded="true" height="103" name="Multiply" width="90" x="246" y="34"/><br>      <operator activated="true" class="h2o:logistic_regression" compatibility="9.10.001" expanded="true" height="124" name="Logistic Regression" width="90" x="380" y="34"><br>        <parameter key="solver" value="AUTO"/><br>        <parameter key="reproducible" value="false"/><br>        <parameter key="maximum_number_of_threads" value="4"/><br>        <parameter key="use_regularization" value="false"/><br>        <parameter key="lambda_search" value="false"/><br>        <parameter key="number_of_lambdas" value="0"/><br>        <parameter key="lambda_min_ratio" value="0.0"/><br>        <parameter key="early_stopping" value="true"/><br>        <parameter key="stopping_rounds" value="3"/><br>        <parameter key="stopping_tolerance" value="0.001"/><br>        <parameter key="standardize" value="true"/><br>        <parameter key="non-negative_coefficients" value="false"/><br>        <parameter key="add_intercept" value="true"/><br>        <parameter key="compute_p-values" value="true"/><br>        <parameter key="remove_collinear_columns" value="true"/><br>        <parameter key="missing_values_handling" value="MeanImputation"/><br>        <parameter key="max_iterations" value="0"/><br>        <parameter key="max_runtime_seconds" value="0"/><br>      </operator><br>      <operator activated="true" class="blending:set_positive_value" compatibility="9.10.001" expanded="true" height="82" name="Set Positive Value" origin="GENERATED_TUTORIAL" width="90" x="380" y="238"><br>        <parameter key="positive_values" value="Play␝no"/><br>      </operator><br>      <operator activated="true" class="apply_model" compatibility="9.10.001" expanded="true" height="82" name="Apply Model" width="90" x="514" y="34"><br>        <list key="application_parameters"/><br>        <parameter key="create_view" value="false"/><br>      </operator><br>      <operator activated="true" class="performance" compatibility="9.10.001" expanded="true" height="82" name="Performance" width="90" x="648" y="34"><br>        <parameter key="use_example_weights" value="true"/><br>      </operator><br>      <operator activated="true" class="h2o:logistic_regression" compatibility="9.10.001" expanded="true" height="124" name="Logistic Regression (2)" width="90" x="514" y="238"><br>        <parameter key="solver" value="AUTO"/><br>        <parameter key="reproducible" value="false"/><br>        <parameter key="maximum_number_of_threads" value="4"/><br>        <parameter key="use_regularization" value="false"/><br>        <parameter key="lambda_search" value="false"/><br>        <parameter key="number_of_lambdas" value="0"/><br>        <parameter key="lambda_min_ratio" value="0.0"/><br>        <parameter key="early_stopping" value="true"/><br>        <parameter key="stopping_rounds" value="3"/><br>        <parameter key="stopping_tolerance" value="0.001"/><br>        <parameter key="standardize" value="true"/><br>        <parameter key="non-negative_coefficients" value="false"/><br>        <parameter key="add_intercept" value="true"/><br>        <parameter key="compute_p-values" value="true"/><br>        <parameter key="remove_collinear_columns" value="true"/><br>        <parameter key="missing_values_handling" value="MeanImputation"/><br>        <parameter key="max_iterations" value="0"/><br>        <parameter key="max_runtime_seconds" value="0"/><br>      </operator><br>      <operator activated="true" class="apply_model" compatibility="9.10.001" expanded="true" height="82" name="Apply Model (2)" width="90" x="648" y="238"><br>        <list key="application_parameters"/><br>        <parameter key="create_view" value="false"/><br>      </operator><br>      <operator activated="true" class="performance" compatibility="9.10.001" expanded="true" height="82" name="Performance (Set Pos)" width="90" x="782" y="238"><br>        <parameter key="use_example_weights" value="true"/><br>      </operator><br>      <connect from_op="Retrieve Golf" from_port="output" to_op="Multiply" to_port="input"/><br>      <connect from_op="Multiply" from_port="output 1" to_op="Logistic Regression" to_port="training set"/><br>      <connect from_op="Multiply" from_port="output 2" to_op="Set Positive Value" to_port="example set input"/><br>      <connect from_op="Logistic Regression" from_port="model" to_op="Apply Model" to_port="model"/><br>      <connect from_op="Logistic Regression" from_port="exampleSet" to_op="Apply Model" to_port="unlabelled data"/><br>      <connect from_op="Set Positive Value" from_port="example set output" to_op="Logistic Regression (2)" to_port="training set"/><br>      <connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/><br>      <connect from_op="Performance" from_port="performance" to_port="result 1"/><br>      <connect from_op="Logistic Regression (2)" from_port="model" to_op="Apply Model (2)" to_port="model"/><br>      <connect from_op="Logistic Regression (2)" from_port="exampleSet" to_op="Apply Model (2)" to_port="unlabelled data"/><br>      <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Performance (Set Pos)" to_port="labelled data"/><br>      <connect from_op="Performance (Set Pos)" from_port="performance" to_port="result 2"/><br>      <portSpacing port="source_input 1" spacing="0"/><br>      <portSpacing port="sink_result 1" spacing="0"/><br>      <portSpacing port="sink_result 2" spacing="0"/><br>      <portSpacing port="sink_result 3" spacing="0"/><br>    </process><br>  </operator><br></process><br><br>



Answers

  • User141505User141505 Member Posts: 8 Contributor II
    Thank you. That's really helpful.

    Another questione i have Is this:
    Is there a way to have the odds ratio for every predictor? I am using the performance (binomial) And i can not find a way to have It.
    Thank you again and Happy new year.
Sign In or Register to comment.