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

error running R operator in RM

dfc2000dfc2000 Member Posts: 1 Learner III
edited October 2019 in Help
Hello,

I installed R extension and I am trying to get R classification operators (e.g. Naive Bayes) to work. However I got this error when running the process. Any idea? Don't know which package make.task comes from. The R console seems to work fine.

Jul 21, 2014 2:53:56 PM INFO: No filename given for result file, using stdout for logging results!
Jul 21, 2014 2:53:56 PM INFO: Process //myLocalRepository/process-dsa-cmt starts
Jul 21, 2014 2:53:57 PM INFO: Loading initial data.
Jul 21, 2014 2:53:57 PM INFO: Naive Bayes: Error: could not find function "make.task"

Jul 21, 2014 2:53:57 PM INFO: Naive Bayes: Error in serialize(rm.data.model, NULL) :
 object 'rm.data.model' not found

Jul 21, 2014 2:53:57 PM INFO: Naive Bayes: Error in print(rm.data.model) : object 'rm.data.model' not found


More info --
I found "make.task" call in com\rapidminer\resources\r\defaultOperators.xml from rmx_r-5.3.0.jar:

<learner name="r.classification.naive_bayes">
      <!--
        This is the code for the learning of the model. The train data is delivered as variable called "rm.data.train". The label and the weight attribute are called
        "rm.data.train.label", respectively "rm.data.train.weight". Weights may not be defined! The resulting model must be saved as "rm.data.model".
      -->
      <code>
        library(mlr);
        if (exists("rm.data.train.weight")){
            ct &lt;- make.task(data = rm.data.train, target = rm.data.train.label, excluded = rm.data.train.weight, weights = rm.data.train.weight)};
        if (!exists("rm.data.train.weight")){
            ct &lt;- make.task(data = rm.data.train, target = rm.data.train.label)
        }
        rm.data.model &lt;- train("classif.naiveBayes", ct);
      </code>
      <!--
        This is the code for applying the model on a new data set. This data frame has already been ensured, that the signature is exactly equal to what has been delivered above.
        The data us delivered in "rm.data.apply", while the model is stored in "rm.data.model". The results have to be stored in "rm.data.result".
      -->
      <apply>
        library(mlr);
        rm.data.result &lt;- as.data.frame(predict(rm.data.model, newdata = rm.data.apply, type="prob")); 
      </apply>
      <capabilities>
        <capability>NUMERICAL_ATTRIBUTES</capability>
        <capability>POLYNOMINAL_LABEL</capability>
        <capability>BINOMINAL_LABEL</capability>
      </capabilities>
  </learner>

This seems to be a mismatch since I believe the current version (2.1) of mlr package uses method "makeClassifTask" instead.

Is there a newer (>5.3.0) version of R extension?
Tagged:
Sign In or Register to comment.