Hi
I would like to get R syntax to put in the open source code in EM for the following models to compare
Decision Tree
Reg
Neural Net
Also the packages and libraries needed
thanks!
Here is basic code for using the open source integration node for a decision tree in R. I use this code all the time 🙂
library(rpart)
&EMR_MODEL <- rpart(
&EMR_CLASS_TARGET ~ &EMR_CLASS_INPUT + &EMR_NUM_INPUT, data=&EMR_IMPORT_DATA,method ="class")
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
Here is basic code for doing a logistic regression in R using the open source node in EM.
&EMR_MODEL <- glm(&EMR_CLASS_TARGET ~ &EMR_CLASS_INPUT + &EMR_NUM_INPUT,
family=binomial(), data=&EMR_IMPORT_DATA)
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
Basic code for Random Forest in R using the Open Source Node in EM.
#load library
library(randomForest)
#train model
&EMR_MODEL <- randomForest(&EMR_CLASS_TARGET ~ &EMR_CLASS_INPUT + &EMR_NUM_INPUT, ntree=100, mtry=5, data=&EMR_IMPORT_DATA, importance=TRUE)
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
Basic code for neural networks in R using the Open Source node in EM.
library(nnet)
&EMR_MODEL <- nnet(&EMR_CLASS_TARGET ~ &EMR_CLASS_INPUT + &EMR_NUM_INPUT, size=2, rang=0.1, data=&EMR_IMPORT_DATA)
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.