"non numeric argument to binary operator" when running R in Rapidminer

cpmysorecpmysore MemberPosts:3Contributor I
edited November 2018 inHelp
Hi ! I am trying to run a simple logistic regression between Promotion (Binary) and Stats(Binary). The code works in R, but when I try to replicate the code in Rapidminer's R extension, it gives the following error message.

CODE (have tried multiple options)
logModel <- glm(Promotion ~ Stats,family="binomial"('logit'),data =data)
logModel <- glm(formula=Promotion ~ Stats,family=binomial(logit),data =data)

I have done preprocessing - (a) naming Promotion as "label", "binomial", (b) nominal to numerical transformation (c) selecting attributes, set role.

Still I end up with the following ERROR
non numeric argument to binary operator


Any suggestions/tips appreciated in advances.
Tagged:

Answers

  • David_ADavid_A Administrator, Moderator, Employee, RMResearcher, MemberPosts:286RM Research
    Hi,

    one possible problem might be that when loading the data into R, the classes are not correctly identified as factors in the data frame.
    I tried to reproduce your problem (see the code below) and I had also to set the Promotion label as factor in the R script.


    Best,
    David





    <宏/ >

    < =“tru运营商激活e" class="process" compatibility="7.0.001" expanded="true" name="Process">

    < =“tru运营商激活e" class="generate_data" compatibility="7.0.001" expanded="true" height="68" name="Generate Data" width="90" x="45" y="34">


    < =“tru运营商激活e" class="rename" compatibility="7.0.001" expanded="true" height="82" name="Rename" width="90" x="246" y="34">






    < =“tru运营商激活e" class="select_attributes" compatibility="7.0.001" expanded="true" height="82" name="Select Attributes" width="90" x="447" y="34">



    < =“tru运营商激活e" class="r_scripting:execute_r" compatibility="6.5.000-SNAPSHOT" expanded="true" height="82" name="Execute R" width="90" x="715" y="34">












Sign InorRegisterto comment.