gowtham Y.R
gowtham Y.R

Reputation: 121

Result of RapidMiner model -> input to Execute R Script

I am very sorry if it is a wrong place to post a question on rapid miner . I am just posting to try my luck to get an answer.

I am new to rapidminer, I was able to implement a couple of R models(C5,rpart) in rapid miner successfully. Now I am trying to use the result of rapid miner model (Decision Tree) as input to R script , I am getting the below error :

"Incompatible data (Decision Tree) delivered at port input 1. The data delivered at the specified port was of the wrong type."

Unable to find a way to read the output of Rapidminer as input to R-script. What I am trying to achieve: I want to create a new field in the final output that explains in text how a data point was predicted as 0 or 1 (Binary -Decision Tree)

Example: if my model takes three variables a,b,c had the below conditions:

a>10 b<5 :1 {1=6,0=0} c<5 :0 {1=0,0=3}

So in my final dataset it should have created a column for all 1's with text "a>10 & b<5" and all 0 as "C<5" My Execute R script will have 2 inputs 1)Model (which has the conditions) 2)Test dataset+predictions (on which the text variable has to be created)

Any help/tips would be greatly appreciated.

Upvotes: 0

Views: 302

Answers (1)

David
David

Reputation: 792

The R-Script Operator excepts either a RapidMiner ExampleSet or a R object, that's why you get an error. You could use the "Decision Tree to Example Set" from the Converters Extension to get the set of rules in the decision tree as an ExampleSet.

Otherwise, if you want to apply your decision tree model, just use the "Apply Model" Operator in RapidMiner, then you get a new column with the predicted label, as well as an confidence value for this prediction.

Upvotes: 2

Related Questions