The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 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.
Options

execute R

deadestianideadestiani Member Posts: 4 Newbie
edited November 2019 in Help
i have scripst C5.0 in r, how make execute in rapid miner ?


dataseratus <- read.csv("C:/Desktop/dataseratus.csv")

View(dataseratus)
str(dataseratus)

table(dataseratus$Prediksi)
table(dataseratus$Global_intensity)
table(dataseratus$Voltage)
table(dataseratus$Global_re_aktiv)
table(dataseratus$Global_aktiv)


dataseratus$Prediksi<-as.factor(dataseratus$Prediksi)

summary(dataseratus$Global_re_aktiv)
summary(dataseratus$Voltage)
summary(dataseratus$Global_aktiv)
summary(dataseratus$Global_intensity)



set.seed(1000)
dataseratus_train <-dataseratus[2:9000,]
dataseratus_test <-dataseratus[9001:10002,]
prop.table(table(dataseratus_train$Prediksi))
prop.table(table(dataseratus_test$Prediksi))

View(dataseratus_train)
View(dataseratus_test)

library(C50)

dataseratus_model <- C5.0(dataseratus_train[1:5],dataseratus_train$Prediksi)

dataseratus_model
dataseratus_model$tree
plot(dataseratus_model)
summary(dataseratus_model)
dataseratus_pred<-predict(dataseratus_model,dataseratus_test)
library (gmodels)
CrossTable(dataseratus_test$Prediksi,dataseratus_pred,prop.chisq=FALSE,Prop.r=FALSE,dnn=c('actual prediksi','predicted prediksi'))


Tagged:

Answers

  • Options
    rfuentealbarfuentealba Moderator, RapidMiner Certified Analyst, Member, University Professor Posts: 568 Unicorn

    There is an extension named "R Scripting Extension", you can find it in the RapidMiner Marketplace if in the menu you go to Extensions > Marketplace.

    You must configure your R interpreter to execute R code inside RapidMiner. For this, go to Settings > Preferences and beneath the "R Scripting" tab, you should give your installation of R. RapidMiner requires a package to handle datasets, but I don't know of anyone.

    Finally, you can find "R Scripting" on the operators window, drag it and input your code where it's applicable.

    All the best,

    Rodrigo.
  • Options
    varunm1varunm1 Moderator, Member Posts: 1,207 Unicorn
    edited November 2019
    Adding to @rfuentealba comment, you can check the sample R script usage in R in the below link for better understanding and defining necessary functions in rapidminer R operator

    https://docs.rapidminer.com/latest/studio/operators/utility/scripting/execute_r.html
    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

  • Options
    deadestianideadestiani Member Posts: 4 Newbie
    but apply model R parsing fieled 
  • Options
    deadestianideadestiani Member Posts: 4 Newbie

  • Options
    Pavithra_RaoPavithra_Rao Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 123 RM Data Scientist
    hI @deadestiani

    Could you please share process XML so we can look into the process flow and what exactly is causing this error. Thank you.

    Cheers,
    Pavithra
  • Options
    rfuentealbarfuentealba Moderator, RapidMiner Certified Analyst, Member, University Professor Posts: 568 Unicorn
    Hello @deadestiani,

    I have two comments here that might help you solving your problem.
    1. You don't have an R-CRAN repository configured in your $HOME/.Rprofile file. You should never install packages inside your scripts (unless you create an R script to replicate your package setup), but if you do, you may want to configure one by adding the following line to your .Rprofile file instead of specifying the repo as an argument to install.packages():
      <code><span>http://cran.us.r-project.org</span>")))
      options(repos=structure(c(CRAN="
    2. You should never use "install.packages" inside a script. Better launch R and install packages from there before using those with RapidMiner. Otherwise, whenever you execute a RapidMiner process, you will have delays because R will connect to the Web Server, check that the latest version is already installed, install if it isn't...
    3. Don't underestimate the power of learning a little about the R console. You aren't required to become an expert in terminals and stuff, but installing and updating packages globally is a must.
    That's all I got for today, let's see if something goes sideways tomorrow.

    All the best,

    Rodrigo.

Sign In or Register to comment.