JBeazer
JBeazer

Reputation: 25

Receiving an R-based error message in Azure ML but not in R itself

This is my first time posting so I apologize if I don't have all my crap together.

I am fairly new to Azure ML and R, but I am trying to implement a Logit model through R in Azure since it doesn't seem to be one of the Microsoft-provided models in Azure ML.

When I run my model and other code in RStudio, I don't get any errors, but when I try to implement it through a "Create R Module" in Azure, I get an error message saying:

"Error 0063: The following error occurred during evaluation of R script: ---------- Start of error message from R ---------- cannot coerce class ""function"" to a data.frame ----------- End of error message from R -----------"

There seems to be very little Azure ML documentation that covers R model creation out there, so I thought I would turn here for some potential answers. It is likely that I am just missing something.

Here is the code I have been running:

Blockquote Trainer Script

model<-glm(Mat_Bin~Mat.Mkt.Pen+debt+Urban.Vmi+GDP.Per.Capita+Avg.Low+MSAcrash, data=data, family=binomial)

Scorer R Script

scores<-as.data.frame(predict(model, subset(data, select=c(predict.MatModel3.))))

names(scores)<-c("Predicted Values")

I tried to upload pictures of everything, but apparently I need higher reputation to do so. But my experiment is super simple. Just some simple column manipulation and then the training and scoring of my model.

Any ideas on why I am getting that error message?

Upvotes: 2

Views: 541

Answers (1)

IRTFM
IRTFM

Reputation: 263451

If it's just a simple naming error on your part, you could try:

model <- glm(Mat_Bin ~ Mat.Mkt.Pen + debt + Urban.Vmi+ GDP.Per.Capita + Avg.Low+MSAcrash, 
             data=scores, family=binomial)

Upvotes: 0

Related Questions